Make WordPress Core


Ignore:
Timestamp:
07/10/2014 09:43:49 PM (11 years ago)
Author:
wonderboymusic
Message:

Media Grid: make registering Screen Options for non-list tables more generic.

See #24716.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/screen.php

    r29078 r29079  
    10231023            isset( $wp_meta_boxes[ $this->id ] )
    10241024            || $this->get_option( 'per_page' )
    1025             || $this->get_option( 'media_grid_title' )
     1025            || $this->get_option( 'misc_screen_options' )
    10261026            || ( $columns && empty( $columns['_title'] ) )
    10271027        ) : ?>
     
    10771077                <br class="clear" />
    10781078            </div>
    1079         <?php elseif ( $this->get_option( 'media_grid_title' ) ): ?>
    1080             <div class="metabox-prefs media-grid-prefs">
     1079        <?php elseif ( $this->get_option( 'misc_screen_options' ) ):
     1080            $misc_options = $this->get_option( 'misc_screen_options' );
     1081        ?>
     1082            <div class="metabox-prefs misc-screen-options" data-id="<?php echo esc_attr( $misc_options['id'] ) ?>">
    10811083            <?php
    1082             $option = get_user_option( 'manageuploadgridcolumnshidden' );
     1084
     1085            $option = get_user_option( $misc_options['option'] );
    10831086            $hidden = array();
    10841087            if ( ! empty( $option ) ) {
     
    10861089            }
    10871090            foreach ( $this->_options as $column => $args ) {
     1091                if ( 'misc_screen_options' === $column ) {
     1092                    continue;
     1093                }
    10881094                $id = "$column-hide";
    10891095                echo '<label for="' . $id . '">';
    1090                 $saved = str_replace( 'media_grid_', '', $column );
    1091                 echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( ! in_array( $saved, $hidden ), true, false ) . ' />';
     1096                echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( ! in_array( $column, $hidden ), true, false ) . ' />';
    10921097                echo $args['label'] . "</label>\n";
    10931098            } ?>
Note: See TracChangeset for help on using the changeset viewer.