Media Grid: Screen Options for grid have to play nice with Screen Options for list. This was fun.

See #24716.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor
2014-07-10 21:26:16 +00:00
parent a89060013b
commit a9fb59151b
4 changed files with 20 additions and 5 deletions

View File

@@ -419,7 +419,11 @@ function wp_print_media_templates() {
if ( _.contains( data.controller.options.mode, 'grid' ) ) { #>
<div class="data-fields">
<?php
$hidden = get_hidden_columns( get_current_screen() );
$option = get_user_option( 'manageuploadgridcolumnshidden' );
$hidden = array();
if ( ! empty( $option ) ) {
$hidden = $option;
}
$fields = array( 'title', 'uploadedTo', 'dateFormatted', 'mime' );
foreach ( $fields as $field ):
$class_name = in_array( $field, $hidden ) ? 'data-field data-hidden' : 'data-field data-visible';