From ced6b063a3b7cb7f7b33d9eafb356881ca1ea199 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 2 Jan 2016 04:45:22 +0000 Subject: [PATCH] List Tables: When a user has hidden all columns, do not override that with the `default_hidden_columns` filter. Merges [36154] to the 4.4 branch. Props Compute, jorbin, voldemortensen. Fixes #35057. Built from https://develop.svn.wordpress.org/branches/4.4@36155 git-svn-id: http://core.svn.wordpress.org/branches/4.4@36121 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/screen.php | 8 ++++++-- wp-includes/version.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/screen.php b/wp-admin/includes/screen.php index 8db0cde433..a320f0e193 100644 --- a/wp-admin/includes/screen.php +++ b/wp-admin/includes/screen.php @@ -57,7 +57,9 @@ function get_hidden_columns( $screen ) { $hidden = get_user_option( 'manage' . $screen->id . 'columnshidden' ); - if ( ! $hidden ) { + $use_defaults = ! is_array( $hidden ); + + if ( $use_defaults ) { $hidden = array(); /** @@ -75,11 +77,13 @@ function get_hidden_columns( $screen ) { * Filter the list of hidden columns. * * @since 4.4.0 + * @since 4.4.1 Added the `use_defaults` parameter. * * @param array $hidden An array of hidden columns. * @param WP_Screen $screen WP_Screen object of the current screen. + * @param bool $use_defaults Whether to show the default columns. */ - return apply_filters( 'hidden_columns', $hidden, $screen ); + return apply_filters( 'hidden_columns', $hidden, $screen, $use_defaults ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index a22182bfa0..b488b7f055 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4.1-alpha-36153'; +$wp_version = '4.4.1-alpha-36155'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.