X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/9e77185fafaf4e60e2b73821e0e4b9b1a11fb85f..38ac4bc40322ecdc4052db4263466573e01fa51f:/wp-admin/upload.php?ds=sidebyside diff --git a/wp-admin/upload.php b/wp-admin/upload.php index 646381e9..39fa165f 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -24,8 +24,21 @@ if ( 'grid' === $mode ) { wp_enqueue_media(); wp_enqueue_script( 'media-grid' ); wp_enqueue_script( 'media' ); + + $q = $_GET; + // let JS handle this + unset( $q['s'] ); + $vars = wp_edit_attachments_query_vars( $q ); + $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' => (object) $vars ) ); get_current_screen()->add_help_tab( array( @@ -48,7 +61,7 @@ if ( 'grid' === $mode ) { get_current_screen()->set_help_sidebar( '
' . __( 'For more information:' ) . '
' . - '' . __( 'Documentation on Media Library' ) . '
' . + '' . __( 'Documentation on Media Library' ) . '
' . '' . __( 'Support Forums' ) . '
' ); @@ -57,7 +70,7 @@ if ( 'grid' === $mode ) { require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?> -' . __( 'For more information:' ) . '
' . - '' . __( 'Documentation on Media Library' ) . '
' . + '' . __( 'Documentation on Media Library' ) . '
' . '' . __( 'Support Forums' ) . '
' ); @@ -237,28 +219,48 @@ if ( ! empty( $_REQUEST['s'] ) ) ' . __('Undo') . ''; $_SERVER['REQUEST_URI'] = remove_query_arg(array('trashed'), $_SERVER['REQUEST_URI']); } if ( ! empty( $_GET['untrashed'] ) && $untrashed = absint( $_GET['untrashed'] ) ) { - $message = sprintf( _n( 'Media attachment restored from the trash.', '%d media attachments restored from the trash.', $untrashed ), number_format_i18n( $_GET['untrashed'] ) ); + if ( 1 == $untrashed ) { + $message = __( 'Media attachment restored from the trash.' ); + } else { + $message = _n( '%d media attachment restored from the trash.', '%d media attachments restored from the trash.', $untrashed ); + } + $message = sprintf( $message, number_format_i18n( $untrashed ) ); $_SERVER['REQUEST_URI'] = remove_query_arg(array('untrashed'), $_SERVER['REQUEST_URI']); } @@ -274,10 +276,10 @@ if ( ! empty( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) { } if ( !empty($message) ) { ?> -