Make WordPress Core

Changeset 49568


Ignore:
Timestamp:
11/12/2020 03:44:58 PM (4 years ago)
Author:
antpb
Message:

Media: Allow users to switch from media grid to list mode in media library.

Fixes issue where media modal would open when switching from grid to list mode.

Props mista-flo, mukesh27.

Fixes #51396.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media-template.php

    r49223 r49568  
    310310    <?php // Template for the view switchers, used for example in the Media Grid. ?>
    311311    <script type="text/html" id="tmpl-media-library-view-switcher">
    312         <a href="<?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ); ?>" class="view-list">
     312        <a href="<?php echo esc_url( add_query_arg( 'mode', 'list', admin_url( 'upload.php' ) ) ); ?>" class="view-list">
    313313            <span class="screen-reader-text"><?php _e( 'List view' ); ?></span>
    314314        </a>
    315         <a href="<?php echo esc_url( add_query_arg( 'mode', 'grid', $_SERVER['REQUEST_URI'] ) ); ?>" class="view-grid current" aria-current="page">
     315        <a href="<?php echo esc_url( add_query_arg( 'mode', 'grid', admin_url( 'upload.php' ) ) ); ?>" class="view-grid current" aria-current="page">
    316316            <span class="screen-reader-text"><?php _e( 'Grid view' ); ?></span>
    317317        </a>
Note: See TracChangeset for help on using the changeset viewer.