WordPress.org

Make WordPress Core

Ticket #51396: 51396.1.patch

File 51396.1.patch, 1.1 KB (added by Mista-Flo, 13 months ago)

Fix with PHP

  • src/wp-includes/media-template.php

    diff --git a/src/wp-includes/media-template.php b/src/wp-includes/media-template.php
    index 1f69382f12..30b9d8a6f7 100644
    a b function wp_print_media_templates() { 
    309309
    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>
    318318        </script>