Make WordPress Core

Changeset 55338


Ignore:
Timestamp:
02/14/2023 04:24:11 PM (2 years ago)
Author:
hellofromTonya
Message:

Editor: Remove missing postType and postId query args Site Editor redirect.

Removes the server-side redirection if missing postType and postId query args when visiting Site Editor. Why? This redirect is no longer needed as the routing is now handled client side (via [55333]).

References:

Follow-up to [55333], [53413], [53093].

Props ntsekouras, youknowriad.
Fixes #57716.

File:
1 edited

Legend:

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

    r55288 r55338  
    2727if ( ! wp_is_block_theme() && ! $is_template_part_editor ) {
    2828    wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) );
    29 }
    30 
    31 /**
    32  * Do a server-side redirection if missing `postType` and `postId`
    33  * query args when visiting Site Editor.
    34  */
    35 $home_template = _resolve_home_block_template();
    36 if ( $home_template && empty( $_GET['postType'] ) && empty( $_GET['postId'] ) ) {
    37     if ( ! empty( $_GET['styles'] ) ) {
    38         $home_template['styles'] = sanitize_key( $_GET['styles'] );
    39     }
    40     $redirect_url = add_query_arg(
    41         $home_template,
    42         admin_url( 'site-editor.php' )
    43     );
    44     wp_safe_redirect( $redirect_url );
    45     exit;
    4629}
    4730
Note: See TracChangeset for help on using the changeset viewer.