'3', 'content_effect' => 'fadeIn', 'tab_label_1' => 'Recent Posts', 'tab_content_1' => 'posts', 'tab_label_2' => 'Comments', 'tab_content_2' => 'comments', 'tab_label_3' => 'Tags', 'tab_content_3' => 'tags' ); $theme->options['widgets_options']['tabs'] = is_array($theme->options['widgets_options']['tabs']) ? array_merge($themater_tabs_defaults, $theme->options['widgets_options']['tabs']) : $themater_tabs_defaults; add_action('widgets_init', create_function('', 'return register_widget("ThematerTabs");')); class ThematerTabs extends WP_Widget { var $defaults; var $posts_defaults; var $comments_defaults; function __construct() { global $theme; $this->defaults = $theme->options['widgets_options']['tabs']; $this->posts_defaults = $theme->options['widgets_options']['posts']; $this->comments_defaults = $theme->options['widgets_options']['comments']; $widget_options = array('description' => __('Allows you to add multiple widgets in tabs. ', 'themater') ); $control_options = array( 'width' => 320); $this->WP_Widget('themater_tabs', '» Tabs Widget', $widget_options,$control_options); } function widget($args, $instance) { extract( $args ); $this_id = str_replace(array('--', '-1-'), array('-', '-' . rand() . '-'),$this->get_field_id('id')); ?>
comments_defaults['comments_number']; $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved, comment_type, SUBSTRING(comment_content,1,50) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT $comments_number"; $comments = $wpdb->get_results($sql); ?> defaults['number']; $i++) { $instance['tab_label_' . $i] = strip_tags($new_instance['tab_label_' . $i]); $instance['tab_content_' . $i] = strip_tags($new_instance['tab_content_' . $i]); } return $instance; } function form($instance) { $instance = wp_parse_args( (array) $instance, $this->defaults ); ?>