Changeset 43571 for trunk/src/wp-admin/includes/class-wp-list-table.php
- Timestamp:
- 08/17/2018 01:50:26 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-list-table.php
r43019 r43571 138 138 public function __construct( $args = array() ) { 139 139 $args = wp_parse_args( 140 $args, array( 140 $args, 141 array( 141 142 'plural' => '', 142 143 'singular' => '', … … 275 276 protected function set_pagination_args( $args ) { 276 277 $args = wp_parse_args( 277 $args, array( 278 $args, 279 array( 278 280 'total_items' => 0, 279 281 'total_pages' => 0, … … 361 363 echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />'; 362 364 } 363 ?>365 ?> 364 366 <p class="search-box"> 365 367 <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label> 366 368 <input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" /> 367 <?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?>369 <?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?> 368 370 </p> 369 <?php371 <?php 370 372 } 371 373 … … 569 571 $extra_checks 570 572 ORDER BY post_date DESC 571 ", $post_type 573 ", 574 $post_type 572 575 ) 573 576 ); … … 590 593 591 594 $m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0; 592 ?>595 ?> 593 596 <label for="filter-by-date" class="screen-reader-text"><?php _e( 'Filter by date' ); ?></label> 594 597 <select name="m" id="filter-by-date"> 595 598 <option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option> 596 <?php597 foreach ( $months as $arc_row ) {598 if ( 0 == $arc_row->year ) {599 continue;600 }601 602 $month = zeroise( $arc_row->month, 2 );603 $year = $arc_row->year;604 605 printf(606 "<option %s value='%s'>%s</option>\n",607 selected( $m, $year . $month, false ),608 esc_attr( $arc_row->year . $month ),609 /* translators: 1: month name, 2: 4-digit year */610 sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )611 );612 }613 ?>599 <?php 600 foreach ( $months as $arc_row ) { 601 if ( 0 == $arc_row->year ) { 602 continue; 603 } 604 605 $month = zeroise( $arc_row->month, 2 ); 606 $year = $arc_row->year; 607 608 printf( 609 "<option %s value='%s'>%s</option>\n", 610 selected( $m, $year . $month, false ), 611 esc_attr( $arc_row->year . $month ), 612 /* translators: 1: month name, 2: 4-digit year */ 613 sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year ) 614 ); 615 } 616 ?> 614 617 </select> 615 <?php618 <?php 616 619 } 617 620 … … 624 627 */ 625 628 protected function view_switcher( $current_mode ) { 626 ?>629 ?> 627 630 <input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" /> 628 631 <div class="view-switch"> 629 <?php630 foreach ( $this->modes as $mode => $title ) {631 $classes = array( 'view-' . $mode );632 if ( $current_mode === $mode ) {633 $classes[] = 'current';634 }635 printf(636 "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",637 esc_url( add_query_arg( 'mode', $mode ) ),638 implode( ' ', $classes ),639 $title640 );641 }632 <?php 633 foreach ( $this->modes as $mode => $title ) { 634 $classes = array( 'view-' . $mode ); 635 if ( $current_mode === $mode ) { 636 $classes[] = 'current'; 637 } 638 printf( 639 "<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n", 640 esc_url( add_query_arg( 'mode', $mode ) ), 641 implode( ' ', $classes ), 642 $title 643 ); 644 } 642 645 ?> 643 646 </div> 644 <?php647 <?php 645 648 } 646 649 … … 678 681 'p' => $post_id, 679 682 'comment_status' => 'approved', 680 ), admin_url( 'edit-comments.php' ) 683 ), 684 admin_url( 'edit-comments.php' ) 681 685 ) 682 686 ), … … 700 704 'p' => $post_id, 701 705 'comment_status' => 'moderated', 702 ), admin_url( 'edit-comments.php' ) 706 ), 707 admin_url( 'edit-comments.php' ) 703 708 ) 704 709 ), … … 1153 1158 1154 1159 $this->screen->render_screen_reader_content( 'heading_list' ); 1155 ?>1160 ?> 1156 1161 <table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>"> 1157 1162 <thead> … … 1162 1167 1163 1168 <tbody id="the-list" 1164 <?php1165 if ( $singular ) {1166 echo " data-wp-lists='list:$singular'";1167 }1169 <?php 1170 if ( $singular ) { 1171 echo " data-wp-lists='list:$singular'"; 1172 } 1168 1173 ?> 1169 1174 > … … 1178 1183 1179 1184 </table> 1180 <?php1185 <?php 1181 1186 $this->display_tablenav( 'bottom' ); 1182 1187 } … … 1210 1215 <?php $this->bulk_actions( $which ); ?> 1211 1216 </div> 1212 <?php1217 <?php 1213 1218 endif; 1214 1219 $this->extra_tablenav( $which ); … … 1218 1223 <br class="clear" /> 1219 1224 </div> 1220 <?php1225 <?php 1221 1226 } 1222 1227
Note: See TracChangeset
for help on using the changeset viewer.