From 2e4c03da18b95730a771263ed8dd26c00eade983 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Wed, 27 Nov 2024 13:38:10 +0100 Subject: [PATCH] Remove posts redirectins --- lib/compat/wordpress-6.8/site-editor.php | 32 ------------------------ 1 file changed, 32 deletions(-) diff --git a/lib/compat/wordpress-6.8/site-editor.php b/lib/compat/wordpress-6.8/site-editor.php index 7ad0c89456c4c..cde108830b1d2 100644 --- a/lib/compat/wordpress-6.8/site-editor.php +++ b/lib/compat/wordpress-6.8/site-editor.php @@ -15,20 +15,6 @@ function ( $settings ) { } ); -function gutenberg_get_posts_dataviews_url( $path = '', $query = array() ) { - $query_string = build_query( - array_merge( - $query, - $path ? array( - 'page' => 'gutenberg-posts-dashboard', - 'p' => $path, - ) : array( 'page' => 'gutenberg-posts-dashboard' ) - ) - ); - $base_url = admin_url( 'admin.php' ); - return $query_string ? $base_url . '?' . $query_string : $base_url; -} - function gutenberg_get_site_editor_redirection() { global $pagenow; if ( 'site-editor.php' !== $pagenow || isset( $_REQUEST['p'] ) || ! $_SERVER['QUERY_STRING'] ) { @@ -119,24 +105,6 @@ function gutenberg_redirect_site_editor_deprecated_urls() { } add_action( 'admin_init', 'gutenberg_redirect_site_editor_deprecated_urls' ); -function gutenberg_redirect_posts_dataviews_to_post() { - global $pagenow; - if ( - 'admin.php' !== $pagenow || - ! isset( $_REQUEST['page'] ) || - 'gutenberg-posts-dashboard' !== $_REQUEST['page'] || - isset( $_REQUEST['p'] ) - ) { - return; - } - - wp_redirect( gutenberg_get_posts_dataviews_url( '/' ), 301 ); - exit; -} - -add_action( 'admin_init', 'gutenberg_redirect_posts_dataviews_to_post' ); - - /** * Filter the `wp_die_handler` to allow access to the Site Editor's new pages page * for Classic themes.