Media Grid: Move toggling of visible fields to Screen Options. This moves us in a better direction... but this will probably need to be massaged again.

See #24716.


git-svn-id: https://develop.svn.wordpress.org/trunk@29077 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2014-07-10 20:59:12 +00:00
parent 55acbf6e40
commit 3ebde0c4d6
8 changed files with 53 additions and 70 deletions
+17 -1
View File
@@ -1019,7 +1019,12 @@ final class WP_Screen {
?>
<div id="screen-options-wrap" class="hidden" tabindex="-1" aria-label="<?php esc_attr_e('Screen Options Tab'); ?>">
<form id="adv-settings" action="" method="post">
<?php if ( isset( $wp_meta_boxes[ $this->id ] ) || $this->get_option( 'per_page' ) || ( $columns && empty( $columns['_title'] ) ) ) : ?>
<?php if (
isset( $wp_meta_boxes[ $this->id ] )
|| $this->get_option( 'per_page' )
|| $this->get_option( 'media_grid_title' )
|| ( $columns && empty( $columns['_title'] ) )
) : ?>
<h5><?php _e( 'Show on screen' ); ?></h5>
<?php
endif;
@@ -1071,6 +1076,17 @@ final class WP_Screen {
?>
<br class="clear" />
</div>
<?php elseif ( $this->get_option( 'media_grid_title' ) ): ?>
<div class="metabox-prefs media-grid-prefs">
<?php foreach ( $this->_options as $column => $args ) {
$id = "$column-hide";
echo '<label for="' . $id . '">';
$saved = str_replace( 'media_grid_', '', $column );
echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( ! in_array( $saved, $hidden ), true, false ) . ' />';
echo $args['label'] . "</label>\n";
} ?>
<br class="clear" />
</div>
<?php endif;
$this->render_screen_layout();