Editor: Add no-js fallback for site editor.

Add a fallback condition with heading and error notice to handle a no JavaScript state for the site editor, comparable to what already exists in the post editor. 

Props afercia, joedolson, fencermonir, zebaafiashama, alexstine, rudlinkon.
Fixes #56228.
Built from https://develop.svn.wordpress.org/trunk@56025


git-svn-id: http://core.svn.wordpress.org/trunk@55537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson
2023-06-25 19:54:22 +00:00
parent 8d987eef49
commit 5fc049a79c
6 changed files with 31 additions and 6 deletions

View File

@@ -132,7 +132,30 @@ do_action( 'enqueue_block_editor_assets' );
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div id="site-editor" class="edit-site"></div>
<div class="edit-site">
<div id="site-editor"></div>
<?php // JavaScript is disabled. ?>
<div class="wrap hide-if-js site-editor-no-js">
<h1 class="wp-heading-inline"><?php _e( 'Edit site' ); ?></h1>
<div class="notice notice-error notice-alt">
<p>
<?php
/**
* Filters the message displayed in the site editor interface when JavaScript is
* not enabled in the browser.
*
* @since 6.3.0
*
* @param string $message The message being displayed.
* @param WP_Post $post The post being edited.
*/
echo apply_filters( 'site_editor_no_javascript_message', __( 'The site editor requires JavaScript. Please enable JavaScript in your browser settings.' ), $post );
?>
</p>
</div>
</div>
</div>
<?php