Changeset 28532
- Timestamp:
- 05/19/2014 05:29:42 PM (11 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/date.php
r28252 r28532 106 106 * 'comment_date', 'comment_date_gmt'. 107 107 */ 108 function __construct( $date_query, $default_column = 'post_date' ) {108 public function __construct( $date_query, $default_column = 'post_date' ) { 109 109 if ( empty( $date_query ) || ! is_array( $date_query ) ) 110 110 return; -
trunk/src/wp-includes/default-widgets.php
r28449 r28532 14 14 class WP_Widget_Pages extends WP_Widget { 15 15 16 function __construct() {16 public function __construct() { 17 17 $widget_ops = array('classname' => 'widget_pages', 'description' => __( 'A list of your site’s Pages.') ); 18 18 parent::__construct('pages', __('Pages'), $widget_ops); 19 19 } 20 20 21 function widget( $args, $instance ) {21 public function widget( $args, $instance ) { 22 22 23 23 /** … … 68 68 } 69 69 70 function update( $new_instance, $old_instance ) {70 public function update( $new_instance, $old_instance ) { 71 71 $instance = $old_instance; 72 72 $instance['title'] = strip_tags($new_instance['title']); … … 82 82 } 83 83 84 function form( $instance ) {84 public function form( $instance ) { 85 85 //Defaults 86 86 $instance = wp_parse_args( (array) $instance, array( 'sortby' => 'post_title', 'title' => '', 'exclude' => '') ); … … 114 114 class WP_Widget_Links extends WP_Widget { 115 115 116 function __construct() {116 public function __construct() { 117 117 $widget_ops = array('description' => __( "Your blogroll" ) ); 118 118 parent::__construct('links', __('Links'), $widget_ops); 119 119 } 120 120 121 function widget( $args, $instance ) {121 public function widget( $args, $instance ) { 122 122 123 123 $show_description = isset($instance['description']) ? $instance['description'] : false; … … 152 152 } 153 153 154 function update( $new_instance, $old_instance ) {154 public function update( $new_instance, $old_instance ) { 155 155 $new_instance = (array) $new_instance; 156 156 $instance = array( 'images' => 0, 'name' => 0, 'description' => 0, 'rating' => 0 ); … … 170 170 } 171 171 172 function form( $instance ) {172 public function form( $instance ) { 173 173 174 174 //Defaults … … 223 223 class WP_Widget_Search extends WP_Widget { 224 224 225 function __construct() {225 public function __construct() { 226 226 $widget_ops = array('classname' => 'widget_search', 'description' => __( "A search form for your site.") ); 227 227 parent::__construct( 'search', _x( 'Search', 'Search widget' ), $widget_ops ); 228 228 } 229 229 230 function widget( $args, $instance ) {230 public function widget( $args, $instance ) { 231 231 232 232 /** This filter is documented in wp-includes/default-widgets.php */ … … 244 244 } 245 245 246 function form( $instance ) {246 public function form( $instance ) { 247 247 $instance = wp_parse_args( (array) $instance, array( 'title' => '') ); 248 248 $title = $instance['title']; … … 252 252 } 253 253 254 function update( $new_instance, $old_instance ) {254 public function update( $new_instance, $old_instance ) { 255 255 $instance = $old_instance; 256 256 $new_instance = wp_parse_args((array) $new_instance, array( 'title' => '')); … … 268 268 class WP_Widget_Archives extends WP_Widget { 269 269 270 function __construct() {270 public function __construct() { 271 271 $widget_ops = array('classname' => 'widget_archive', 'description' => __( 'A monthly archive of your site’s Posts.') ); 272 272 parent::__construct('archives', __('Archives'), $widget_ops); 273 273 } 274 274 275 function widget( $args, $instance ) {275 public function widget( $args, $instance ) { 276 276 $c = ! empty( $instance['count'] ) ? '1' : '0'; 277 277 $d = ! empty( $instance['dropdown'] ) ? '1' : '0'; … … 333 333 } 334 334 335 function update( $new_instance, $old_instance ) {335 public function update( $new_instance, $old_instance ) { 336 336 $instance = $old_instance; 337 337 $new_instance = wp_parse_args( (array) $new_instance, array( 'title' => '', 'count' => 0, 'dropdown' => '') ); … … 343 343 } 344 344 345 function form( $instance ) {345 public function form( $instance ) { 346 346 $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'count' => 0, 'dropdown' => '') ); 347 347 $title = strip_tags($instance['title']); … … 368 368 class WP_Widget_Meta extends WP_Widget { 369 369 370 function __construct() {370 public function __construct() { 371 371 $widget_ops = array('classname' => 'widget_meta', 'description' => __( "Login, RSS, & WordPress.org links.") ); 372 372 parent::__construct('meta', __('Meta'), $widget_ops); 373 373 } 374 374 375 function widget( $args, $instance ) {375 public function widget( $args, $instance ) { 376 376 377 377 /** This filter is documented in wp-includes/default-widgets.php */ … … 409 409 } 410 410 411 function update( $new_instance, $old_instance ) {411 public function update( $new_instance, $old_instance ) { 412 412 $instance = $old_instance; 413 413 $instance['title'] = strip_tags($new_instance['title']); … … 416 416 } 417 417 418 function form( $instance ) {418 public function form( $instance ) { 419 419 $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); 420 420 $title = strip_tags($instance['title']); … … 432 432 class WP_Widget_Calendar extends WP_Widget { 433 433 434 function __construct() {434 public function __construct() { 435 435 $widget_ops = array('classname' => 'widget_calendar', 'description' => __( 'A calendar of your site’s Posts.') ); 436 436 parent::__construct('calendar', __('Calendar'), $widget_ops); 437 437 } 438 438 439 function widget( $args, $instance ) {439 public function widget( $args, $instance ) { 440 440 441 441 /** This filter is documented in wp-includes/default-widgets.php */ … … 452 452 } 453 453 454 function update( $new_instance, $old_instance ) {454 public function update( $new_instance, $old_instance ) { 455 455 $instance = $old_instance; 456 456 $instance['title'] = strip_tags($new_instance['title']); … … 459 459 } 460 460 461 function form( $instance ) {461 public function form( $instance ) { 462 462 $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); 463 463 $title = strip_tags($instance['title']); … … 476 476 class WP_Widget_Text extends WP_Widget { 477 477 478 function __construct() {478 public function __construct() { 479 479 $widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML.')); 480 480 $control_ops = array('width' => 400, 'height' => 350); … … 482 482 } 483 483 484 function widget( $args, $instance ) {484 public function widget( $args, $instance ) { 485 485 486 486 /** This filter is documented in wp-includes/default-widgets.php */ … … 505 505 } 506 506 507 function update( $new_instance, $old_instance ) {507 public function update( $new_instance, $old_instance ) { 508 508 $instance = $old_instance; 509 509 $instance['title'] = strip_tags($new_instance['title']); … … 516 516 } 517 517 518 function form( $instance ) {518 public function form( $instance ) { 519 519 $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'text' => '' ) ); 520 520 $title = strip_tags($instance['title']); … … 538 538 class WP_Widget_Categories extends WP_Widget { 539 539 540 function __construct() {540 public function __construct() { 541 541 $widget_ops = array( 'classname' => 'widget_categories', 'description' => __( "A list or dropdown of categories." ) ); 542 542 parent::__construct('categories', __('Categories'), $widget_ops); 543 543 } 544 544 545 function widget( $args, $instance ) {545 public function widget( $args, $instance ) { 546 546 547 547 /** This filter is documented in wp-includes/default-widgets.php */ … … 609 609 } 610 610 611 function update( $new_instance, $old_instance ) {611 public function update( $new_instance, $old_instance ) { 612 612 $instance = $old_instance; 613 613 $instance['title'] = strip_tags($new_instance['title']); … … 619 619 } 620 620 621 function form( $instance ) {621 public function form( $instance ) { 622 622 //Defaults 623 623 $instance = wp_parse_args( (array) $instance, array( 'title' => '') ); … … 650 650 class WP_Widget_Recent_Posts extends WP_Widget { 651 651 652 function __construct() {652 public function __construct() { 653 653 $widget_ops = array('classname' => 'widget_recent_entries', 'description' => __( "Your site’s most recent Posts.") ); 654 654 parent::__construct('recent-posts', __('Recent Posts'), $widget_ops); … … 660 660 } 661 661 662 function widget($args, $instance) {662 public function widget($args, $instance) { 663 663 $cache = array(); 664 664 if ( ! $this->is_preview() ) { … … 738 738 } 739 739 740 function update( $new_instance, $old_instance ) {740 public function update( $new_instance, $old_instance ) { 741 741 $instance = $old_instance; 742 742 $instance['title'] = strip_tags($new_instance['title']); … … 752 752 } 753 753 754 function flush_widget_cache() {754 public function flush_widget_cache() { 755 755 wp_cache_delete('widget_recent_posts', 'widget'); 756 756 } 757 757 758 function form( $instance ) {758 public function form( $instance ) { 759 759 $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 760 760 $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; … … 780 780 class WP_Widget_Recent_Comments extends WP_Widget { 781 781 782 function __construct() {782 public function __construct() { 783 783 $widget_ops = array('classname' => 'widget_recent_comments', 'description' => __( 'Your site’s most recent comments.' ) ); 784 784 parent::__construct('recent-comments', __('Recent Comments'), $widget_ops); … … 793 793 } 794 794 795 function recent_comments_style() {795 public function recent_comments_style() { 796 796 797 797 /** … … 811 811 } 812 812 813 function flush_widget_cache() {813 public function flush_widget_cache() { 814 814 wp_cache_delete('widget_recent_comments', 'widget'); 815 815 } 816 816 817 function widget( $args, $instance ) {817 public function widget( $args, $instance ) { 818 818 global $comments, $comment; 819 819 … … 886 886 } 887 887 888 function update( $new_instance, $old_instance ) {888 public function update( $new_instance, $old_instance ) { 889 889 $instance = $old_instance; 890 890 $instance['title'] = strip_tags($new_instance['title']); … … 899 899 } 900 900 901 function form( $instance ) {901 public function form( $instance ) { 902 902 $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 903 903 $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5; … … 919 919 class WP_Widget_RSS extends WP_Widget { 920 920 921 function __construct() {921 public function __construct() { 922 922 $widget_ops = array( 'description' => __('Entries from any RSS or Atom feed.') ); 923 923 $control_ops = array( 'width' => 400, 'height' => 200 ); … … 925 925 } 926 926 927 function widget($args, $instance) {927 public function widget($args, $instance) { 928 928 929 929 if ( isset($instance['error']) && $instance['error'] ) … … 978 978 } 979 979 980 function update($new_instance, $old_instance) {980 public function update($new_instance, $old_instance) { 981 981 $testurl = ( isset( $new_instance['url'] ) && ( !isset( $old_instance['url'] ) || ( $new_instance['url'] != $old_instance['url'] ) ) ); 982 982 return wp_widget_rss_process( $new_instance, $testurl ); 983 983 } 984 984 985 function form($instance) {985 public function form($instance) { 986 986 987 987 if ( empty($instance) ) … … 1213 1213 class WP_Widget_Tag_Cloud extends WP_Widget { 1214 1214 1215 function __construct() {1215 public function __construct() { 1216 1216 $widget_ops = array( 'description' => __( "A cloud of your most used tags.") ); 1217 1217 parent::__construct('tag_cloud', __('Tag Cloud'), $widget_ops); 1218 1218 } 1219 1219 1220 function widget( $args, $instance ) {1220 public function widget( $args, $instance ) { 1221 1221 $current_taxonomy = $this->_get_current_taxonomy($instance); 1222 1222 if ( !empty($instance['title']) ) { … … 1258 1258 } 1259 1259 1260 function update( $new_instance, $old_instance ) {1260 public function update( $new_instance, $old_instance ) { 1261 1261 $instance['title'] = strip_tags(stripslashes($new_instance['title'])); 1262 1262 $instance['taxonomy'] = stripslashes($new_instance['taxonomy']); … … 1264 1264 } 1265 1265 1266 function form( $instance ) {1266 public function form( $instance ) { 1267 1267 $current_taxonomy = $this->_get_current_taxonomy($instance); 1268 1268 ?> … … 1281 1281 } 1282 1282 1283 function _get_current_taxonomy($instance) {1283 public function _get_current_taxonomy($instance) { 1284 1284 if ( !empty($instance['taxonomy']) && taxonomy_exists($instance['taxonomy']) ) 1285 1285 return $instance['taxonomy']; … … 1296 1296 class WP_Nav_Menu_Widget extends WP_Widget { 1297 1297 1298 function __construct() {1298 public function __construct() { 1299 1299 $widget_ops = array( 'description' => __('Add a custom menu to your sidebar.') ); 1300 1300 parent::__construct( 'nav_menu', __('Custom Menu'), $widget_ops ); 1301 1301 } 1302 1302 1303 function widget($args, $instance) {1303 public function widget($args, $instance) { 1304 1304 // Get menu 1305 1305 $nav_menu = ! empty( $instance['nav_menu'] ) ? wp_get_nav_menu_object( $instance['nav_menu'] ) : false; … … 1321 1321 } 1322 1322 1323 function update( $new_instance, $old_instance ) {1323 public function update( $new_instance, $old_instance ) { 1324 1324 $instance = array(); 1325 1325 if ( ! empty( $new_instance['title'] ) ) { … … 1332 1332 } 1333 1333 1334 function form( $instance ) {1334 public function form( $instance ) { 1335 1335 $title = isset( $instance['title'] ) ? $instance['title'] : ''; 1336 1336 $nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : '';
Note: See TracChangeset
for help on using the changeset viewer.