Skip to content

Commit 828d287

Browse files
Administration: Pull the table_view_mode filter for now.
The extensibility of list table view modes will be explored in a future release. Props audrasjb. See #49715. git-svn-id: https://develop.svn.wordpress.org/trunk@48668 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 18f5561 commit 828d287

3 files changed

Lines changed: 9 additions & 35 deletions

File tree

‎src/wp-admin/includes/class-wp-list-table.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,9 +1270,6 @@ public function display() {
12701270
protected function get_table_classes() {
12711271
$mode = get_user_setting( 'posts_list_mode', 'list' );
12721272

1273-
/** This filter is documented in wp-admin/includes/class-wp-screen.php */
1274-
$mode = apply_filters( 'table_view_mode', $mode );
1275-
12761273
$mode_class = esc_attr( 'table-view-' . $mode );
12771274

12781275
return array( 'widefat', 'fixed', 'striped', $mode_class, $this->_args['plural'] );

‎src/wp-admin/includes/class-wp-posts-list-table.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,6 @@ public function current_action() {
602602
protected function get_table_classes() {
603603
global $mode;
604604

605-
/** This filter is documented in wp-admin/includes/class-wp-screen.php */
606-
$mode = apply_filters( 'table_view_mode', $mode );
607-
608605
$mode_class = esc_attr( 'table-view-' . $mode );
609606

610607
return array( 'widefat', 'fixed', 'striped', $mode_class, is_post_type_hierarchical( $this->screen->post_type ) ? 'pages' : 'posts' );

‎src/wp-admin/includes/class-wp-screen.php‎

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,39 +1315,19 @@ public function render_view_mode() {
13151315

13161316
$mode = get_user_setting( 'posts_list_mode', 'list' );
13171317

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-
13281318
// This needs a submit button.
13291319
add_filter( 'screen_options_show_submit', '__return_true' );
13301320
?>
13311321
<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>
13511331
</fieldset>
13521332
<?php
13531333
}

0 commit comments

Comments
 (0)