mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@56025 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -573,7 +573,8 @@ code {
|
||||
margin: 10px 20px 0 2px;
|
||||
}
|
||||
|
||||
.wrap.block-editor-no-js {
|
||||
.wrap.block-editor-no-js,
|
||||
.wrap.site-editor-no-js {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user