diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php
index 4ccf607162..6d67d88636 100644
|
a
|
b
|
class WP_List_Table { |
| 1270 | 1270 | protected function get_table_classes() { |
| 1271 | 1271 | $mode = get_user_setting( 'posts_list_mode', 'list' ); |
| 1272 | 1272 | |
| 1273 | | /** This filter is documented in wp-admin/includes/class-wp-screen.php */ |
| 1274 | | $mode = apply_filters( 'table_view_mode', $mode ); |
| 1275 | | |
| 1276 | 1273 | $mode_class = esc_attr( 'table-view-' . $mode ); |
| 1277 | 1274 | |
| 1278 | 1275 | return array( 'widefat', 'fixed', 'striped', $mode_class, $this->_args['plural'] ); |
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 4dd0928736..a7d4748840 100644
|
a
|
b
|
class WP_Posts_List_Table extends WP_List_Table { |
| 602 | 602 | protected function get_table_classes() { |
| 603 | 603 | global $mode; |
| 604 | 604 | |
| 605 | | /** This filter is documented in wp-admin/includes/class-wp-screen.php */ |
| 606 | | $mode = apply_filters( 'table_view_mode', $mode ); |
| 607 | | |
| 608 | 605 | $mode_class = esc_attr( 'table-view-' . $mode ); |
| 609 | 606 | |
| 610 | 607 | return array( 'widefat', 'fixed', 'striped', $mode_class, is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts' ); |
diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php
index fd64c17855..ce98c2c840 100644
|
a
|
b
|
final class WP_Screen { |
| 1315 | 1315 | |
| 1316 | 1316 | $mode = get_user_setting( 'posts_list_mode', 'list' ); |
| 1317 | 1317 | |
| 1318 | | /** |
| 1319 | | * Filters the current view mode. |
| 1320 | | * |
| 1321 | | * @since 5.5.0 |
| 1322 | | * |
| 1323 | | * @param string $mode The current selected mode. Defaults to the value |
| 1324 | | * of 'posts_list_mode' user setting. |
| 1325 | | */ |
| 1326 | | $mode = apply_filters( 'table_view_mode', $mode ); |
| 1327 | | |
| 1328 | 1318 | // This needs a submit button. |
| 1329 | 1319 | add_filter( 'screen_options_show_submit', '__return_true' ); |
| 1330 | 1320 | ?> |
| 1331 | 1321 | <fieldset class="metabox-prefs view-mode"> |
| 1332 | | <legend><?php _e( 'View mode' ); ?></legend> |
| 1333 | | <label for="list-view-mode"> |
| 1334 | | <input id="list-view-mode" type="radio" name="mode" value="list" <?php checked( 'list', $mode ); ?> /> |
| 1335 | | <?php _e( 'Compact view' ); ?> |
| 1336 | | </label> |
| 1337 | | <label for="excerpt-view-mode"> |
| 1338 | | <input id="excerpt-view-mode" type="radio" name="mode" value="excerpt" <?php checked( 'excerpt', $mode ); ?> /> |
| 1339 | | <?php _e( 'Extended view' ); ?> |
| 1340 | | </label> |
| 1341 | | <?php |
| 1342 | | /** |
| 1343 | | * Fires at the end of the table view modes screen option. |
| 1344 | | * |
| 1345 | | * @since 5.5.0 |
| 1346 | | * |
| 1347 | | * @param string $mode The currently selected mode. |
| 1348 | | */ |
| 1349 | | do_action( 'wp_table_view_modes', $mode ); |
| 1350 | | ?> |
| | 1322 | <legend><?php _e( 'View mode' ); ?></legend> |
| | 1323 | <label for="list-view-mode"> |
| | 1324 | <input id="list-view-mode" type="radio" name="mode" value="list" <?php checked( 'list', $mode ); ?> /> |
| | 1325 | <?php _e( 'Compact view' ); ?> |
| | 1326 | </label> |
| | 1327 | <label for="excerpt-view-mode"> |
| | 1328 | <input id="excerpt-view-mode" type="radio" name="mode" value="excerpt" <?php checked( 'excerpt', $mode ); ?> /> |
| | 1329 | <?php _e( 'Extended view' ); ?> |
| | 1330 | </label> |
| 1351 | 1331 | </fieldset> |
| 1352 | 1332 | <?php |
| 1353 | 1333 | } |