- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/default-widgets.php
r17825 r17260 14 14 class WP_Widget_Pages extends WP_Widget { 15 15 16 function __construct() {16 function WP_Widget_Pages() { 17 17 $widget_ops = array('classname' => 'widget_pages', 'description' => __( 'Your site’s WordPress Pages') ); 18 parent::__construct('pages', __('Pages'), $widget_ops);18 $this->WP_Widget('pages', __('Pages'), $widget_ops); 19 19 } 20 20 … … 90 90 class WP_Widget_Links extends WP_Widget { 91 91 92 function __construct() {92 function WP_Widget_Links() { 93 93 $widget_ops = array('description' => __( "Your blogroll" ) ); 94 parent::__construct('links', __('Links'), $widget_ops);94 $this->WP_Widget('links', __('Links'), $widget_ops); 95 95 } 96 96 … … 171 171 class WP_Widget_Search extends WP_Widget { 172 172 173 function __construct() {173 function WP_Widget_Search() { 174 174 $widget_ops = array('classname' => 'widget_search', 'description' => __( "A search form for your site") ); 175 parent::__construct('search', __('Search'), $widget_ops);175 $this->WP_Widget('search', __('Search'), $widget_ops); 176 176 } 177 177 … … 214 214 class WP_Widget_Archives extends WP_Widget { 215 215 216 function __construct() {216 function WP_Widget_Archives() { 217 217 $widget_ops = array('classname' => 'widget_archive', 'description' => __( 'A monthly archive of your site’s posts') ); 218 parent::__construct('archives', __('Archives'), $widget_ops);218 $this->WP_Widget('archives', __('Archives'), $widget_ops); 219 219 } 220 220 … … 279 279 class WP_Widget_Meta extends WP_Widget { 280 280 281 function __construct() {281 function WP_Widget_Meta() { 282 282 $widget_ops = array('classname' => 'widget_meta', 'description' => __( "Log in/out, admin, feed and WordPress links") ); 283 parent::__construct('meta', __('Meta'), $widget_ops);283 $this->WP_Widget('meta', __('Meta'), $widget_ops); 284 284 } 285 285 … … 327 327 class WP_Widget_Calendar extends WP_Widget { 328 328 329 function __construct() {329 function WP_Widget_Calendar() { 330 330 $widget_ops = array('classname' => 'widget_calendar', 'description' => __( 'A calendar of your site’s posts') ); 331 parent::__construct('calendar', __('Calendar'), $widget_ops);331 $this->WP_Widget('calendar', __('Calendar'), $widget_ops); 332 332 } 333 333 … … 368 368 class WP_Widget_Text extends WP_Widget { 369 369 370 function __construct() {370 function WP_Widget_Text() { 371 371 $widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML')); 372 372 $control_ops = array('width' => 400, 'height' => 350); 373 parent::__construct('text', __('Text'), $widget_ops, $control_ops);373 $this->WP_Widget('text', __('Text'), $widget_ops, $control_ops); 374 374 } 375 375 … … 418 418 class WP_Widget_Categories extends WP_Widget { 419 419 420 function __construct() {420 function WP_Widget_Categories() { 421 421 $widget_ops = array( 'classname' => 'widget_categories', 'description' => __( "A list or dropdown of categories" ) ); 422 parent::__construct('categories', __('Categories'), $widget_ops);422 $this->WP_Widget('categories', __('Categories'), $widget_ops); 423 423 } 424 424 … … 510 510 class WP_Widget_Recent_Posts extends WP_Widget { 511 511 512 function __construct() {512 function WP_Widget_Recent_Posts() { 513 513 $widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "The most recent posts on your site") ); 514 parent::__construct('recent-posts', __('Recent Posts'), $widget_ops);514 $this->WP_Widget('recent-posts', __('Recent Posts'), $widget_ops); 515 515 $this->alt_option_name = 'widget_recent_entries'; 516 516 … … 538 538 $number = 10; 539 539 540 $r = new WP_Query(array('posts_per_page' => $number, 'no _found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true));540 $r = new WP_Query(array('posts_per_page' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => true)); 541 541 if ($r->have_posts()) : 542 542 ?> … … 596 596 class WP_Widget_Recent_Comments extends WP_Widget { 597 597 598 function __construct() {598 function WP_Widget_Recent_Comments() { 599 599 $widget_ops = array('classname' => 'widget_recent_comments', 'description' => __( 'The most recent comments' ) ); 600 parent::__construct('recent-comments', __('Recent Comments'), $widget_ops);600 $this->WP_Widget('recent-comments', __('Recent Comments'), $widget_ops); 601 601 $this->alt_option_name = 'widget_recent_comments'; 602 602 … … 641 641 $number = 5; 642 642 643 $comments = get_comments( array( 'number' => $number, 'status' => 'approve' , 'post_status' => 'publish') );643 $comments = get_comments( array( 'number' => $number, 'status' => 'approve' ) ); 644 644 $output .= $before_widget; 645 645 if ( $title ) … … 693 693 class WP_Widget_RSS extends WP_Widget { 694 694 695 function __construct() {695 function WP_Widget_RSS() { 696 696 $widget_ops = array( 'description' => __('Entries from any RSS or Atom feed') ); 697 697 $control_ops = array( 'width' => 400, 'height' => 200 ); 698 parent::__construct( 'rss', __('RSS'), $widget_ops, $control_ops );698 $this->WP_Widget( 'rss', __('RSS'), $widget_ops, $control_ops ); 699 699 } 700 700 … … 714 714 715 715 // self-url destruction sequence 716 if ( in_array( untrailingslashit( $url ), array( site_url(), home_url() )) )716 if ( $url == site_url() || $url == home_url() ) 717 717 return; 718 718 … … 986 986 class WP_Widget_Tag_Cloud extends WP_Widget { 987 987 988 function __construct() {988 function WP_Widget_Tag_Cloud() { 989 989 $widget_ops = array( 'description' => __( "Your most used tags in cloud format") ); 990 parent::__construct('tag_cloud', __('Tag Cloud'), $widget_ops);990 $this->WP_Widget('tag_cloud', __('Tag Cloud'), $widget_ops); 991 991 } 992 992 … … 1053 1053 class WP_Nav_Menu_Widget extends WP_Widget { 1054 1054 1055 function __construct() {1055 function WP_Nav_Menu_Widget() { 1056 1056 $widget_ops = array( 'description' => __('Use this widget to add one of your custom menus as a widget.') ); 1057 parent:: __construct( 'nav_menu', __('Custom Menu'), $widget_ops );1057 parent::WP_Widget( 'nav_menu', __('Custom Menu'), $widget_ops ); 1058 1058 } 1059 1059
Note: See TracChangeset
for help on using the changeset viewer.