'widget_wpden_tabs', 'description' => __( 'This widget is the Tabs that classically goes into the sidebar. It contains the Popular posts, Latest Posts, Recent comments and a Tag cloud.', 'WPDen' ) ); /* Widget control settings. */ $control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => 'wpden_tabber' ); /* Create the widget. */ $this->WP_Widget( 'wpden_tabber', __('WPDen - Tabber', 'wpden' ), $widget_ops, $control_ops ); } // End Constructor function widget($args, $instance) { extract( $args, EXTR_SKIP ); $instance = $this->wpden_enforce_defaults( $instance ); extract( $instance, EXTR_SKIP ); echo $before_widget; ?>
"latest" && !$latest == "on") { ?> "comments" && !$comments == "on") { ?> "tags" && !$tags == "on") { ?>
wpden_enforce_defaults( $new_instance ); return $new_instance; } // End update() function wpden_enforce_defaults( $instance ) { $defaults = $this->wpden_get_settings(); $instance = wp_parse_args( $instance, $defaults ); $instance['number'] = intval( $instance['number'] ); if ( $instance['number'] < 1 ) $instance['number'] = $defaults['number']; $instance['thumb_size'] = absint( $instance['thumb_size'] ); if ( empty( $instance['order'] ) ) $instance['order'] = $defaults['order']; return $instance; } /** * Provides an array of the settings with the setting name as the key and the default value as the value * This cannot be called get_settings() or it will override WP_Widget::get_settings() */ function wpden_get_settings() { // Set the default to a blank string $settings = array_fill_keys( $this->settings, '' ); // Now set the more specific defaults $settings['number'] = 5; $settings['thumb_size'] = 45; $settings['order'] = 'pop'; return $settings; } /*---------------------------------------- form() ---------------------------------------- * The form on the widget control in the * widget administration area. * Make use of the get_field_id() and * get_field_name() function when creating * your form elements. This handles the confusing stuff. * Params: * - Array $instance ----------------------------------------*/ function form( $instance ) { $instance = $this->wpden_enforce_defaults( $instance ); extract( $instance, EXTR_SKIP ); ?>

>

>

>

>

false, 'ignore_sticky_posts' => 1, 'orderby' => 'comment_count', 'numberposts' => $posts) ); foreach($popular as $post) : setup_postdata($post); ?>
  • 0) { ?><?php the_title(); ?>
  • '" . date('Y-m-d', strtotime('-'.$popular_days.' days')) . "'"; return $where; } /*-----------------------------------------------------------------------------------*/ /* WPDEN Tabber - Latest Posts */ /*-----------------------------------------------------------------------------------*/ if (!function_exists( 'wpden_tabwidget_lastest')) { function wpden_tabwidget_lastest( $posts = 5, $size = 45 ) { global $post; $latest = get_posts( 'ignore_sticky_posts=1&numberposts='. $posts .'&orderby=post_date&order=desc' ); foreach($latest as $post) : setup_postdata($post); ?>
  • 0) { ?><?php the_title(); ?>
  • $posts, 'status' => 'approve' ) ); if ( $comments ) { foreach ( (array) $comments as $comment) { $post = get_post( $comment->comment_post_ID ); ?>
  • 0 ) echo get_avatar( $comment, $size ); ?> comment_author); ?>: comment_content ), 0, 50 ) ); ?>