Changeset 29079
- Timestamp:
- 07/10/2014 09:43:49 PM (10 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/screen.php
r29078 r29079 1023 1023 isset( $wp_meta_boxes[ $this->id ] ) 1024 1024 || $this->get_option( 'per_page' ) 1025 || $this->get_option( 'm edia_grid_title' )1025 || $this->get_option( 'misc_screen_options' ) 1026 1026 || ( $columns && empty( $columns['_title'] ) ) 1027 1027 ) : ?> … … 1077 1077 <br class="clear" /> 1078 1078 </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'] ) ?>"> 1081 1083 <?php 1082 $option = get_user_option( 'manageuploadgridcolumnshidden' ); 1084 1085 $option = get_user_option( $misc_options['option'] ); 1083 1086 $hidden = array(); 1084 1087 if ( ! empty( $option ) ) { … … 1086 1089 } 1087 1090 foreach ( $this->_options as $column => $args ) { 1091 if ( 'misc_screen_options' === $column ) { 1092 continue; 1093 } 1088 1094 $id = "$column-hide"; 1089 1095 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 ) . ' />'; 1092 1097 echo $args['label'] . "</label>\n"; 1093 1098 } ?> -
trunk/src/wp-admin/js/common.js
r29078 r29079 28 28 29 29 saveManageColumnsState : function() { 30 var hidden, page ;31 if ( $( '#media_grid_title-hide' ).length ) {30 var hidden, page, opts = $( '.misc-screen-options' ); 31 if ( opts.length ) { 32 32 hidden = []; 33 $( '.hide-column-tog', '.media-grid-prefs' ).each( function() {34 var $el, field = this.value .replace( 'media_grid_', '' );33 opts.find( '.hide-column-tog' ).each( function() { 34 var $el, field = this.value; 35 35 $el = $( '.data-' + field ); 36 36 if ( ! this.checked ) { … … 41 41 } 42 42 } ); 43 page = pagenow + 'grid';43 page = pagenow + opts.data( 'id' ); 44 44 hidden = hidden.join( ',' ); 45 45 } else { … … 47 47 hidden = this.hidden(); 48 48 } 49 49 50 50 $.post(ajaxurl, { 51 51 action: 'hidden-columns', -
trunk/src/wp-admin/upload.php
r29077 r29079 27 27 wp_localize_script( 'media-grid', 'mediaGridSettings', array( 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ) ) ); 28 28 29 add_screen_option( 'media_grid_title', array( 'label' => __( 'Name' ) ) ); 30 add_screen_option( 'media_grid_uploadedTo', array( 'label' => __( 'Uploaded To' ) ) ); 31 add_screen_option( 'media_grid_dateFormatted', array( 'label' => __( 'Date' ) ) ); 32 add_screen_option( 'media_grid_mime', array( 'label' => __( 'Mime-type' ) ) ); 29 add_screen_option( 'misc_screen_options', array( 'option' => 'manageuploadgridcolumnshidden', 'id' => 'grid' ) ); 30 add_screen_option( 'title', array( 'label' => __( 'Name' ) ) ); 31 add_screen_option( 'uploadedTo', array( 'label' => __( 'Uploaded To' ) ) ); 32 add_screen_option( 'dateFormatted', array( 'label' => __( 'Date' ) ) ); 33 add_screen_option( 'mime', array( 'label' => __( 'Mime-type' ) ) ); 33 34 34 35 require_once( ABSPATH . 'wp-admin/admin-header.php' );
Note: See TracChangeset
for help on using the changeset viewer.