From ada7442b9eade8a72691dfa7bf4d10b9b6563171 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 4 Jan 2015 02:07:23 +0000 Subject: [PATCH] After [31037], ensure that the library is passed as a map to the Media Grid instance. Remove useless query vars. Fixes #30584. Built from https://develop.svn.wordpress.org/trunk@31041 git-svn-id: http://core.svn.wordpress.org/trunk@31022 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/upload.php | 9 +++++++-- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/wp-admin/upload.php b/wp-admin/upload.php index d0aa5e69c4..325612bd31 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -26,11 +26,16 @@ if ( 'grid' === $mode ) { wp_enqueue_script( 'media' ); $vars = wp_edit_attachments_query_vars(); - unset( $vars['mode'], $vars['post_type'], $vars['post_status'], $vars['posts_per_page'] ); + $ignore = array( 'mode', 'post_type', 'post_status', 'posts_per_page' ); + foreach ( $vars as $key => $value ) { + if ( ! $value || in_array( $key, $ignore ) ) { + unset( $vars[ $key ] ); + } + } wp_localize_script( 'media-grid', '_wpMediaGridSettings', array( 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ), - 'queryVars' => $vars + 'queryVars' => (object) $vars ) ); get_current_screen()->add_help_tab( array( diff --git a/wp-includes/version.php b/wp-includes/version.php index 3158597e09..c76b980c46 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31040'; +$wp_version = '4.2-alpha-31041'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.