if ( ! current_user_can( 'edit_theme_options' ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>', 403 ); }
if ( ! wp_is_block_theme() ) { if ( ! current_theme_supports( 'block-template-parts' ) && $is_template_part_editor ) { wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) ); } elseif ( ! $is_patterns_editor && ! $is_template_part_editor ) { wp_die( __( 'The theme you are currently using is not compatible with the Site Editor.' ) ); } }
// Used in the HTML title tag. $title = _x( 'Editor', 'site editor title tag' ); $parent_file = 'themes.php';
// Flag that we're loading the block editor. $current_screen = get_current_screen(); $current_screen->is_block_editor( true );
// Default to is-fullscreen-mode to avoid jumps in the UI. add_filter( 'admin_body_class', static function ( $classes ) { return "$classes is-fullscreen-mode"; } );