Make WordPress Core

Changeset 31041


Ignore:
Timestamp:
01/04/2015 02:06:04 AM (12 years ago)
Author:
wonderboymusic
Message:

After [31037], ensure that the library is passed as a map to the Media Grid instance. Remove useless query vars.

Fixes #30584.

File:
1 edited

Legend:

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

    r31037 r31041  
    2727
    2828        $vars = wp_edit_attachments_query_vars();
    29         unset( $vars['mode'], $vars['post_type'], $vars['post_status'], $vars['posts_per_page'] );
     29        $ignore = array( 'mode', 'post_type', 'post_status', 'posts_per_page' );
     30        foreach ( $vars as $key => $value ) {
     31                if ( ! $value || in_array( $key, $ignore ) ) {
     32                        unset( $vars[ $key ] );
     33                }
     34        }
    3035
    3136        wp_localize_script( 'media-grid', '_wpMediaGridSettings', array(
    3237                'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ),
    33                 'queryVars' => $vars
     38                'queryVars' => (object) $vars
    3439        ) );
    3540
Note: See TracChangeset for help on using the changeset viewer.