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. Built from https://develop.svn.wordpress.org/trunk@55943 git-svn-id: http://core.svn.wordpress.org/trunk@55455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -9,4 +9,27 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
_deprecated_file( basename( __FILE__ ), '6.3.0', 'wp-admin/upload.php' );
|
||||
/** Load WordPress Administration Bootstrap. */
|
||||
require_once __DIR__ . '/admin.php';
|
||||
|
||||
$parent_file = 'upload.php';
|
||||
$submenu_file = 'upload.php';
|
||||
|
||||
wp_reset_vars( array( 'action' ) );
|
||||
|
||||
switch ( $action ) {
|
||||
case 'editattachment':
|
||||
case 'edit':
|
||||
if ( empty( $_GET['attachment_id'] ) ) {
|
||||
wp_redirect( admin_url( 'upload.php?error=deprecated' ) );
|
||||
exit;
|
||||
}
|
||||
$att_id = (int) $_GET['attachment_id'];
|
||||
|
||||
wp_redirect( admin_url( "upload.php?item={$att_id}&error=deprecated" ) );
|
||||
exit;
|
||||
|
||||
default:
|
||||
wp_redirect( admin_url( 'upload.php?error=deprecated' ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user