After [31037], ensure that the library is passed as a map to the Media Grid instance. Remove useless query vars.
Fixes #30584. git-svn-id: https://develop.svn.wordpress.org/trunk@31041 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
3d3e1fb72a
commit
efc61d054e
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user