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:
parent
8d987eef49
commit
5fc049a79c
|
@ -574,7 +574,8 @@ code {
|
|||
margin: 10px 2px 0 20px;
|
||||
}
|
||||
|
||||
.wrap.block-editor-no-js {
|
||||
.wrap.block-editor-no-js,
|
||||
.wrap.site-editor-no-js {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.3-alpha-56024';
|
||||
$wp_version = '6.3-alpha-56025';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue