Make WordPress Core


Ignore:
Timestamp:
06/19/2023 11:18:28 PM (2 years ago)
Author:
peterwilsoncc
Message:

Media: Redirect deprecated wp-admin/media.php file.

Redirect users visiting the wp-admin/media.php file to the media library, wp-admin/upload.php. An user facing warning is displayed when the media library is reached via a deprecated link.

Follow up to [55647].

Props jorbin, audrasjb, azaozz, NekoJonez, kebbet, costdev.
Fixes #57612.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/upload.php

    r55631 r55943  
    142142    wp_enqueue_script( 'media' );
    143143
    144     remove_action( 'admin_head', 'wp_admin_canonical_url' );
     144    // Remove the error parameter added by deprecation of wp-admin/media.php.
     145    add_filter(
     146        'removable_query_args',
     147        function() {
     148            return array( 'error' );
     149        },
     150        10,
     151        0
     152    );
    145153
    146154    $q = $_GET;
Note: See TracChangeset for help on using the changeset viewer.