Ticket #49715: 49715.5.diff
File 49715.5.diff, 9.2 KB (added by , 4 years ago) |
---|
-
src/wp-admin/includes/class-wp-comments-list-table.php
diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php index 904a2dce47..bb4bb2140f 100644
a b class WP_Comments_List_Table extends WP_List_Table { 124 124 $start += $_REQUEST['offset']; 125 125 } 126 126 127 if ( ! empty( $_REQUEST['mode'] ) ) { 128 $mode = 'extended' === $_REQUEST['mode'] ? 'extended' : 'list'; 129 set_user_setting( 'posts_list_mode', $mode ); 130 } else { 131 $mode = get_user_setting( 'posts_list_mode', 'list' ); 132 } 133 127 134 $status_map = array( 128 135 'mine' => '', 129 136 'moderated' => 'hold', … … class WP_Comments_List_Table extends WP_List_Table { 751 758 /** This filter is documented in wp-admin/includes/dashboard.php */ 752 759 $actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment ); 753 760 761 $mode = get_user_setting( 'posts_list_mode', 'list' ); 762 $always_visible = false; 763 if ( 'extended' === $mode ) { 764 $always_visible = true; 765 } 766 754 767 $i = 0; 755 $out .= '<div class=" row-actions">';768 $out .= '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">'; 756 769 foreach ( $actions as $action => $link ) { 757 770 ++$i; 758 771 ( ( ( 'approve' === $action || 'unapprove' === $action ) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | '; -
src/wp-admin/includes/class-wp-list-table.php
diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index d1fe218897..b965da294e 100644
a b class WP_List_Table { 166 166 167 167 if ( empty( $this->modes ) ) { 168 168 $this->modes = array( 169 'list' => __( 'Compact view' ),169 'list' => __( 'Compact view' ), 170 170 'extended' => __( 'Extended view' ), 171 171 ); 172 172 } … … class WP_List_Table { 445 445 $this->_actions = $this->get_bulk_actions(); 446 446 447 447 /** 448 * Filters the list table Bulk Actions drop-down.448 * Filters the list table bulk actions drop-down. 449 449 * 450 450 * The dynamic portion of the hook name, `$this->screen->id`, refers 451 451 * to the ID of the current screen, usually a string. … … class WP_List_Table { 469 469 470 470 echo '<label for="bulk-action-selector-' . esc_attr( $which ) . '" class="screen-reader-text">' . __( 'Select bulk action' ) . '</label>'; 471 471 echo '<select name="action' . $two . '" id="bulk-action-selector-' . esc_attr( $which ) . "\">\n"; 472 echo '<option value="-1">' . __( 'Bulk Actions' ) . "</option>\n";472 echo '<option value="-1">' . __( 'Bulk actions' ) . "</option>\n"; 473 473 474 474 foreach ( $this->_actions as $name => $title ) { 475 475 $class = 'edit' === $name ? ' class="hide-if-no-js"' : ''; … … class WP_List_Table { 1252 1252 * @return string[] Array of CSS classes for the table tag. 1253 1253 */ 1254 1254 protected function get_table_classes() { 1255 $mode = get_user_setting( 'posts_list_mode', 'list' ); 1256 $mode_class = 'extended' === $mode ? 'table-view-extended' : 'table-view-list'; 1255 $mode = get_user_setting( 'posts_list_mode', 'list' ); 1256 /** 1257 * Filters the current view mode. 1258 * 1259 * @since 5.5.0 1260 * 1261 * @param string $mode The current selected mode. Default value of 1262 * posts_list_mode user setting. 1263 */ 1264 $mode = apply_filters( 'table_view_mode', $mode ); 1265 1266 $mode_class = 'extended' === $mode ? 'table-view-extended' : 'table-view-' . $mode; 1267 1257 1268 return array( 'widefat', 'fixed', 'striped', $mode_class, $this->_args['plural'] ); 1258 1269 } 1259 1270 -
src/wp-admin/includes/class-wp-posts-list-table.php
diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 799e43d0ec..809717cc43 100644
a b class WP_Posts_List_Table extends WP_List_Table { 415 415 416 416 if ( current_user_can( $post_type_obj->cap->delete_posts ) ) { 417 417 if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) { 418 $actions['delete'] = __( 'Delete Permanently' );418 $actions['delete'] = __( 'Delete permanently' ); 419 419 } else { 420 $actions['trash'] = __( 'Move to Trash' );420 $actions['trash'] = __( 'Move to trash' ); 421 421 } 422 422 } 423 423 … … class WP_Posts_List_Table extends WP_List_Table { 598 598 * @return array 599 599 */ 600 600 protected function get_table_classes() { 601 $mode = get_user_setting( 'posts_list_mode', 'list' ); 602 $mode_class = 'extended' === $mode ? 'table-view-extended' : 'table-view-list'; 601 $mode = get_user_setting( 'posts_list_mode', 'list' ); 602 /** 603 * Filters the current view mode. 604 * 605 * @since 5.5.0 606 * 607 * @param string $mode The current selected mode. Default value of 608 * posts_list_mode user setting. 609 */ 610 $mode = apply_filters( 'table_view_mode', $mode ); 611 612 $mode_class = 'extended' === $mode ? 'table-view-extended' : 'table-view-' . $mode; 613 603 614 return array( 'widefat', 'fixed', 'striped', $mode_class, is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts' ); 604 615 } 605 616 … … class WP_Posts_List_Table extends WP_List_Table { 1100 1111 * Filters the status text of the post. 1101 1112 * 1102 1113 * @since 4.8.0 1114 * @since 5.5.0 Replaced 'excerpt' mode with 'extended'. 1103 1115 * 1104 1116 * @param string $status The status text. 1105 1117 * @param WP_Post $post Post object. … … class WP_Posts_List_Table extends WP_List_Table { 1112 1124 echo $status . '<br />'; 1113 1125 } 1114 1126 1115 if ( 'extended' === $mode || 'excerpt' === $mode ) { 1116 /** 1117 * Filters the published time of the post. 1118 * 1119 * If `$mode` equals 'extended', the published time and date are both displayed. 1120 * If `$mode` equals 'list' (default), the publish date is displayed, with the 1121 * time and date together available as an abbreviation definition. 1122 * 1123 * @since 2.5.1 1124 * 1125 * @param string $t_time The published time. 1126 * @param WP_Post $post Post object. 1127 * @param string $column_name The column name. 1128 * @param string $mode The list display mode ('extended' or 'list'). 1129 */ 1130 echo apply_filters( 'post_date_column_time', $t_time, $post, 'date', $mode ); 1131 } else { 1132 /** This filter is documented in wp-admin/includes/class-wp-posts-list-table.php */ 1133 echo '<span title="' . $t_time . '">' . apply_filters( 'post_date_column_time', $h_time, $post, 'date', $mode ) . '</span>'; 1134 } 1127 /** 1128 * Filters the published time of the post. 1129 * 1130 * @since 2.5.1 1131 * @since 5.5.0 Removed the difference between 'excerpt' and 'list' modes. 1132 * The published time and date are both displayed now, 1133 * which is equivalent to the previous 'excerpt' mode. 1134 * @since 5.5.0 Replaced 'excerpt' mode with 'extended'. 1135 * 1136 * @param string $t_time The published time. 1137 * @param WP_Post $post Post object. 1138 * @param string $column_name The column name. 1139 * @param string $mode The list display mode ('extended' or 'list'). 1140 */ 1141 echo apply_filters( 'post_date_column_time', $t_time, $post, 'date', $mode ); 1135 1142 } 1136 1143 1137 1144 /** … … class WP_Posts_List_Table extends WP_List_Table { 1459 1466 * 1460 1467 * @since 3.1.0 1461 1468 * 1462 * @global string $mode Compact table view mode.1469 * @global string $mode List table view mode. 1463 1470 */ 1464 1471 public function inline_edit() { 1465 1472 global $mode; -
src/wp-admin/includes/class-wp-screen.php
diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php index 0f86425218..26356d8fde 100644
a b final class WP_Screen { 1289 1289 $screen = get_current_screen(); 1290 1290 1291 1291 // Currently only enabled for posts and comments lists. 1292 if ( 'edit' !== $screen->base && 'edit-comments' !== $screen->base && 'users' !== $screen->base) {1292 if ( 'edit' !== $screen->base && 'edit-comments' !== $screen->base ) { 1293 1293 return; 1294 1294 } 1295 1295 … … final class WP_Screen { 1314 1314 // Set 'list' as default value if $mode is not set. 1315 1315 $mode = ( isset( $mode ) && 'extended' === $mode ) ? 'extended' : 'list'; 1316 1316 1317 /** 1318 * Filters the current view mode. 1319 * 1320 * @since 5.5.0 1321 * 1322 * @param string $mode The current selected mode. Default value of 1323 * posts_list_mode user setting. 1324 */ 1325 $mode = apply_filters( 'table_view_mode', $mode ); 1326 1317 1327 // This needs a submit button. 1318 1328 add_filter( 'screen_options_show_submit', '__return_true' ); 1319 1329 ?> … … final class WP_Screen { 1321 1331 <legend><?php _e( 'View Mode' ); ?></legend> 1322 1332 <label for="list-view-mode"> 1323 1333 <input id="list-view-mode" type="radio" name="mode" value="list" <?php checked( 'list', $mode ); ?> /> 1324 <?php _e( 'Compact view' ); ?>1334 <?php _e( 'Compact View' ); ?> 1325 1335 </label> 1326 1336 <label for="excerpt-view-mode"> 1327 1337 <input id="excerpt-view-mode" type="radio" name="mode" value="extended" <?php checked( 'extended', $mode ); ?> /> 1328 1338 <?php _e( 'Extended View' ); ?> 1329 1339 </label> 1340 <?php 1341 /** 1342 * Fires at the end of the table view modes screen option. 1343 * 1344 * @since 5.5.0 1345 * 1346 * @param string $mode The currently selected mode. 1347 */ 1348 do_action( 'wp_table_view_modes', $mode ); 1349 ?> 1330 1350 </fieldset> 1331 1351 <?php 1332 1352 }