List tables: Allow filtering of hidden and default hidden columns.

Similar to `get_hidden_meta_boxes()`, there are now filters named `default_hidden_columns` and `hidden_columns`.

props Compute, MikeHansenMe, chriscct7.
fixes #32499.

Built from https://develop.svn.wordpress.org/trunk@33689


git-svn-id: http://core.svn.wordpress.org/trunk@33656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2015-08-21 15:32:29 +00:00
parent 09da29102b
commit 514caf0120
2 changed files with 28 additions and 3 deletions

View File

@ -51,10 +51,35 @@ function get_column_headers( $screen ) {
* @return array
*/
function get_hidden_columns( $screen ) {
if ( is_string( $screen ) )
if ( is_string( $screen ) ) {
$screen = convert_to_screen( $screen );
}
return (array) get_user_option( 'manage' . $screen->id . 'columnshidden' );
$hidden = get_user_option( 'manage' . $screen->id . 'columnshidden' );
if ( ! $hidden ) {
$hidden = array();
/**
* Filter the default list of hidden columns.
*
* @since 4.4.0
*
* @param array $hidden An array of columns hidden by default.
* @param WP_Screen $screen WP_Screen object of the current screen.
*/
$hidden = apply_filters( 'default_hidden_columns', $hidden, $screen );
}
/**
* Filter the list of hidden columns.
*
* @since 4.4.0
*
* @param array $hidden An array of hidden columns.
* @param WP_Screen $screen WP_Screen object of the current screen.
*/
return apply_filters( 'hidden_columns', $hidden, $screen );
}
/**

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-33688';
$wp_version = '4.4-alpha-33689';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.