author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:40:08 +0200 | |
changeset 21 | 48c4eec2b7e6 |
parent 19 | 3d72ae0968f4 |
child 22 | 8c2e4d02f4ef |
permissions | -rw-r--r-- |
9 | 1 |
<?php |
2 |
/** |
|
16 | 3 |
* The block editor page. |
9 | 4 |
* |
5 |
* @since 5.0.0 |
|
6 |
* |
|
7 |
* @package WordPress |
|
8 |
* @subpackage Administration |
|
9 |
*/ |
|
10 |
||
16 | 11 |
// Don't load directly. |
9 | 12 |
if ( ! defined( 'ABSPATH' ) ) { |
13 |
die( '-1' ); |
|
14 |
} |
|
15 |
||
16 |
/** |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
17 |
* @global string $post_type Global post type. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
18 |
* @global WP_Post_Type $post_type_object Global post type object. |
16 | 19 |
* @global WP_Post $post Global post object. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
20 |
* @global string $title The title of the current screen. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
21 |
* @global array $wp_meta_boxes Global meta box state. |
9 | 22 |
*/ |
18 | 23 |
global $post_type, $post_type_object, $post, $title, $wp_meta_boxes; |
24 |
||
25 |
$block_editor_context = new WP_Block_Editor_Context( array( 'post' => $post ) ); |
|
9 | 26 |
|
27 |
// Flag that we're loading the block editor. |
|
28 |
$current_screen = get_current_screen(); |
|
29 |
$current_screen->is_block_editor( true ); |
|
30 |
||
18 | 31 |
// Default to is-fullscreen-mode to avoid jumps in the UI. |
32 |
add_filter( |
|
33 |
'admin_body_class', |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
34 |
static function ( $classes ) { |
18 | 35 |
return "$classes is-fullscreen-mode"; |
36 |
} |
|
37 |
); |
|
38 |
||
9 | 39 |
/* |
40 |
* Emoji replacement is disabled for now, until it plays nicely with React. |
|
41 |
*/ |
|
42 |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); |
|
43 |
||
18 | 44 |
/* |
45 |
* Block editor implements its own Options menu for toggling Document Panels. |
|
46 |
*/ |
|
47 |
add_filter( 'screen_options_show_screen', '__return_false' ); |
|
48 |
||
9 | 49 |
wp_enqueue_script( 'heartbeat' ); |
50 |
wp_enqueue_script( 'wp-edit-post' ); |
|
51 |
||
19 | 52 |
$rest_path = rest_get_route_for_post( $post ); |
9 | 53 |
|
54 |
// Preload common data. |
|
55 |
$preload_paths = array( |
|
19 | 56 |
'/wp/v2/types?context=view', |
57 |
'/wp/v2/taxonomies?context=view', |
|
58 |
add_query_arg( |
|
59 |
array( |
|
60 |
'context' => 'edit', |
|
61 |
'per_page' => -1, |
|
62 |
), |
|
63 |
rest_get_route_for_post_type_items( 'wp_block' ) |
|
64 |
), |
|
65 |
add_query_arg( 'context', 'edit', $rest_path ), |
|
9 | 66 |
sprintf( '/wp/v2/types/%s?context=edit', $post_type ), |
19 | 67 |
'/wp/v2/users/me', |
68 |
array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ), |
|
69 |
array( rest_get_route_for_post_type_items( 'page' ), 'OPTIONS' ), |
|
70 |
array( rest_get_route_for_post_type_items( 'wp_block' ), 'OPTIONS' ), |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
71 |
array( rest_get_route_for_post_type_items( 'wp_template' ), 'OPTIONS' ), |
19 | 72 |
sprintf( '%s/autosaves?context=edit', $rest_path ), |
73 |
'/wp/v2/settings', |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
74 |
array( '/wp/v2/settings', 'OPTIONS' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
75 |
'/wp/v2/global-styles/themes/' . get_stylesheet(), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
76 |
'/wp/v2/themes?context=edit&status=active', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
77 |
'/wp/v2/global-styles/' . WP_Theme_JSON_Resolver::get_user_global_styles_post_id() . '?context=edit', |
9 | 78 |
); |
79 |
||
18 | 80 |
block_editor_rest_api_preload( $preload_paths, $block_editor_context ); |
9 | 81 |
|
82 |
wp_add_inline_script( |
|
83 |
'wp-blocks', |
|
84 |
sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( get_block_categories( $post ) ) ), |
|
85 |
'after' |
|
86 |
); |
|
87 |
||
88 |
/* |
|
89 |
* Assign initial edits, if applicable. These are not initially assigned to the persisted post, |
|
90 |
* but should be included in its save payload. |
|
91 |
*/ |
|
19 | 92 |
$initial_edits = array(); |
9 | 93 |
$is_new_post = false; |
94 |
if ( 'auto-draft' === $post->post_status ) { |
|
95 |
$is_new_post = true; |
|
96 |
// Override "(Auto Draft)" new post default title with empty string, or filtered value. |
|
19 | 97 |
if ( post_type_supports( $post->post_type, 'title' ) ) { |
98 |
$initial_edits['title'] = $post->post_title; |
|
99 |
} |
|
100 |
||
101 |
if ( post_type_supports( $post->post_type, 'editor' ) ) { |
|
102 |
$initial_edits['content'] = $post->post_content; |
|
103 |
} |
|
104 |
||
105 |
if ( post_type_supports( $post->post_type, 'excerpt' ) ) { |
|
106 |
$initial_edits['excerpt'] = $post->post_excerpt; |
|
107 |
} |
|
9 | 108 |
} |
109 |
||
110 |
// Preload server-registered block schemas. |
|
111 |
wp_add_inline_script( |
|
112 |
'wp-blocks', |
|
113 |
'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');' |
|
114 |
); |
|
115 |
||
116 |
// Get admin url for handling meta boxes. |
|
117 |
$meta_box_url = admin_url( 'post.php' ); |
|
118 |
$meta_box_url = add_query_arg( |
|
119 |
array( |
|
120 |
'post' => $post->ID, |
|
121 |
'action' => 'edit', |
|
122 |
'meta-box-loader' => true, |
|
123 |
'meta-box-loader-nonce' => wp_create_nonce( 'meta-box-loader' ), |
|
124 |
), |
|
125 |
$meta_box_url |
|
126 |
); |
|
18 | 127 |
wp_add_inline_script( |
128 |
'wp-editor', |
|
129 |
sprintf( 'var _wpMetaBoxUrl = %s;', wp_json_encode( $meta_box_url ) ), |
|
130 |
'before' |
|
131 |
); |
|
9 | 132 |
|
16 | 133 |
/* |
134 |
* Get all available templates for the post/page attributes meta-box. |
|
135 |
* The "Default template" array element should only be added if the array is |
|
136 |
* not empty so we do not trigger the template select element without any options |
|
137 |
* besides the default value. |
|
138 |
*/ |
|
9 | 139 |
$available_templates = wp_get_theme()->get_page_templates( get_post( $post->ID ) ); |
18 | 140 |
$available_templates = ! empty( $available_templates ) ? array_replace( |
9 | 141 |
array( |
142 |
/** This filter is documented in wp-admin/includes/meta-boxes.php */ |
|
143 |
'' => apply_filters( 'default_page_template_title', __( 'Default template' ), 'rest-api' ), |
|
144 |
), |
|
145 |
$available_templates |
|
146 |
) : $available_templates; |
|
147 |
||
148 |
// Lock settings. |
|
149 |
$user_id = wp_check_post_lock( $post->ID ); |
|
150 |
if ( $user_id ) { |
|
151 |
$locked = false; |
|
152 |
||
153 |
/** This filter is documented in wp-admin/includes/post.php */ |
|
154 |
if ( apply_filters( 'show_post_locked_dialog', true, $post, $user_id ) ) { |
|
155 |
$locked = true; |
|
156 |
} |
|
157 |
||
158 |
$user_details = null; |
|
159 |
if ( $locked ) { |
|
160 |
$user = get_userdata( $user_id ); |
|
161 |
$user_details = array( |
|
19 | 162 |
'avatar' => get_avatar_url( $user_id, array( 'size' => 128 ) ), |
163 |
'name' => $user->display_name, |
|
9 | 164 |
); |
165 |
} |
|
166 |
||
167 |
$lock_details = array( |
|
168 |
'isLocked' => $locked, |
|
169 |
'user' => $user_details, |
|
170 |
); |
|
171 |
} else { |
|
172 |
// Lock the post. |
|
173 |
$active_post_lock = wp_set_post_lock( $post->ID ); |
|
16 | 174 |
if ( $active_post_lock ) { |
175 |
$active_post_lock = esc_attr( implode( ':', $active_post_lock ) ); |
|
176 |
} |
|
177 |
||
178 |
$lock_details = array( |
|
9 | 179 |
'isLocked' => false, |
16 | 180 |
'activePostLock' => $active_post_lock, |
9 | 181 |
); |
182 |
} |
|
183 |
||
184 |
/** |
|
185 |
* Filters the body placeholder text. |
|
186 |
* |
|
187 |
* @since 5.0.0 |
|
18 | 188 |
* @since 5.8.0 Changed the default placeholder text. |
9 | 189 |
* |
18 | 190 |
* @param string $text Placeholder text. Default 'Type / to choose a block'. |
9 | 191 |
* @param WP_Post $post Post object. |
192 |
*/ |
|
18 | 193 |
$body_placeholder = apply_filters( 'write_your_story', __( 'Type / to choose a block' ), $post ); |
9 | 194 |
|
195 |
$editor_settings = array( |
|
19 | 196 |
'availableTemplates' => $available_templates, |
197 |
'disablePostFormats' => ! current_theme_supports( 'post-formats' ), |
|
9 | 198 |
/** This filter is documented in wp-admin/edit-form-advanced.php */ |
19 | 199 |
'titlePlaceholder' => apply_filters( 'enter_title_here', __( 'Add title' ), $post ), |
200 |
'bodyPlaceholder' => $body_placeholder, |
|
201 |
'autosaveInterval' => AUTOSAVE_INTERVAL, |
|
202 |
'richEditingEnabled' => user_can_richedit(), |
|
203 |
'postLock' => $lock_details, |
|
204 |
'postLockUtils' => array( |
|
9 | 205 |
'nonce' => wp_create_nonce( 'lock-post_' . $post->ID ), |
206 |
'unlockNonce' => wp_create_nonce( 'update-post_' . $post->ID ), |
|
207 |
'ajaxUrl' => admin_url( 'admin-ajax.php' ), |
|
208 |
), |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
209 |
'supportsLayout' => wp_theme_has_theme_json(), |
19 | 210 |
'supportsTemplateMode' => current_theme_supports( 'block-templates' ), |
9 | 211 |
|
212 |
// Whether or not to load the 'postcustom' meta box is stored as a user meta |
|
213 |
// field so that we're not always loading its assets. |
|
19 | 214 |
'enableCustomFields' => (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ), |
9 | 215 |
); |
216 |
||
19 | 217 |
// Add additional back-compat patterns registered by `current_screen` et al. |
218 |
$editor_settings['__experimentalAdditionalBlockPatterns'] = WP_Block_Patterns_Registry::get_instance()->get_all_registered( true ); |
|
219 |
$editor_settings['__experimentalAdditionalBlockPatternCategories'] = WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered( true ); |
|
220 |
||
18 | 221 |
$autosave = wp_get_post_autosave( $post->ID ); |
9 | 222 |
if ( $autosave ) { |
223 |
if ( mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) { |
|
224 |
$editor_settings['autosave'] = array( |
|
225 |
'editLink' => get_edit_post_link( $autosave->ID ), |
|
226 |
); |
|
227 |
} else { |
|
228 |
wp_delete_post_revision( $autosave->ID ); |
|
229 |
} |
|
230 |
} |
|
231 |
||
232 |
if ( ! empty( $post_type_object->template ) ) { |
|
233 |
$editor_settings['template'] = $post_type_object->template; |
|
234 |
$editor_settings['templateLock'] = ! empty( $post_type_object->template_lock ) ? $post_type_object->template_lock : false; |
|
235 |
} |
|
236 |
||
237 |
// If there's no template set on a new post, use the post format, instead. |
|
238 |
if ( $is_new_post && ! isset( $editor_settings['template'] ) && 'post' === $post->post_type ) { |
|
239 |
$post_format = get_post_format( $post ); |
|
240 |
if ( in_array( $post_format, array( 'audio', 'gallery', 'image', 'quote', 'video' ), true ) ) { |
|
241 |
$editor_settings['template'] = array( array( "core/$post_format" ) ); |
|
242 |
} |
|
243 |
} |
|
244 |
||
19 | 245 |
if ( wp_is_block_theme() && $editor_settings['supportsTemplateMode'] ) { |
246 |
$editor_settings['defaultTemplatePartAreas'] = get_allowed_block_template_part_areas(); |
|
247 |
} |
|
248 |
||
9 | 249 |
/** |
250 |
* Scripts |
|
251 |
*/ |
|
252 |
wp_enqueue_media( |
|
253 |
array( |
|
254 |
'post' => $post->ID, |
|
255 |
) |
|
256 |
); |
|
257 |
wp_tinymce_inline_scripts(); |
|
258 |
wp_enqueue_editor(); |
|
259 |
||
260 |
/** |
|
261 |
* Styles |
|
262 |
*/ |
|
263 |
wp_enqueue_style( 'wp-edit-post' ); |
|
264 |
||
265 |
/** |
|
266 |
* Fires after block assets have been enqueued for the editing interface. |
|
267 |
* |
|
268 |
* Call `add_action` on any hook before 'admin_enqueue_scripts'. |
|
269 |
* |
|
270 |
* In the function call you supply, simply use `wp_enqueue_script` and |
|
271 |
* `wp_enqueue_style` to add your functionality to the block editor. |
|
272 |
* |
|
273 |
* @since 5.0.0 |
|
274 |
*/ |
|
275 |
do_action( 'enqueue_block_editor_assets' ); |
|
276 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
277 |
// In order to duplicate classic meta box behavior, we need to run the classic meta box actions. |
16 | 278 |
require_once ABSPATH . 'wp-admin/includes/meta-boxes.php'; |
9 | 279 |
register_and_do_post_meta_boxes( $post ); |
280 |
||
281 |
// Check if the Custom Fields meta box has been removed at some point. |
|
282 |
$core_meta_boxes = $wp_meta_boxes[ $current_screen->id ]['normal']['core']; |
|
283 |
if ( ! isset( $core_meta_boxes['postcustom'] ) || ! $core_meta_boxes['postcustom'] ) { |
|
284 |
unset( $editor_settings['enableCustomFields'] ); |
|
285 |
} |
|
286 |
||
18 | 287 |
$editor_settings = get_block_editor_settings( $editor_settings, $block_editor_context ); |
9 | 288 |
|
289 |
$init_script = <<<JS |
|
290 |
( function() { |
|
291 |
window._wpLoadBlockEditor = new Promise( function( resolve ) { |
|
292 |
wp.domReady( function() { |
|
293 |
resolve( wp.editPost.initializeEditor( 'editor', "%s", %d, %s, %s ) ); |
|
294 |
} ); |
|
295 |
} ); |
|
296 |
} )(); |
|
297 |
JS; |
|
298 |
||
299 |
$script = sprintf( |
|
300 |
$init_script, |
|
301 |
$post->post_type, |
|
302 |
$post->ID, |
|
303 |
wp_json_encode( $editor_settings ), |
|
304 |
wp_json_encode( $initial_edits ) |
|
305 |
); |
|
306 |
wp_add_inline_script( 'wp-edit-post', $script ); |
|
307 |
||
18 | 308 |
if ( (int) get_option( 'page_for_posts' ) === $post->ID ) { |
309 |
add_action( 'admin_enqueue_scripts', '_wp_block_editor_posts_page_notice' ); |
|
310 |
} |
|
311 |
||
16 | 312 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
9 | 313 |
?> |
314 |
||
315 |
<div class="block-editor"> |
|
316 |
<h1 class="screen-reader-text hide-if-no-js"><?php echo esc_html( $title ); ?></h1> |
|
317 |
<div id="editor" class="block-editor__container hide-if-no-js"></div> |
|
318 |
<div id="metaboxes" class="hidden"> |
|
319 |
<?php the_block_editor_meta_boxes(); ?> |
|
320 |
</div> |
|
321 |
||
322 |
<?php // JavaScript is disabled. ?> |
|
323 |
<div class="wrap hide-if-js block-editor-no-js"> |
|
324 |
<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
325 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
326 |
if ( file_exists( WP_PLUGIN_DIR . '/classic-editor/classic-editor.php' ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
327 |
// If Classic Editor is already installed, provide a link to activate the plugin. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
328 |
$installed = true; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
329 |
$plugin_activate_url = wp_nonce_url( 'plugins.php?action=activate&plugin=classic-editor/classic-editor.php', 'activate-plugin_classic-editor/classic-editor.php' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
330 |
$message = sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
331 |
/* translators: %s: Link to activate the Classic Editor plugin. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
332 |
__( 'The block editor requires JavaScript. Please enable JavaScript in your browser settings, or activate the <a href="%s">Classic Editor plugin</a>.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
333 |
esc_url( $plugin_activate_url ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
334 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
335 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
336 |
// If Classic Editor is not installed, provide a link to install it. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
337 |
$installed = false; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
338 |
$plugin_install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=classic-editor' ), 'install-plugin_classic-editor' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
339 |
$message = sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
340 |
/* translators: %s: Link to install the Classic Editor plugin. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
341 |
__( 'The block editor requires JavaScript. Please enable JavaScript in your browser settings, or install the <a href="%s">Classic Editor plugin</a>.' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
342 |
esc_url( $plugin_install_url ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
343 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
344 |
} |
9 | 345 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
346 |
/** |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
347 |
* Filters the message displayed in the block editor interface when JavaScript is |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
348 |
* not enabled in the browser. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
349 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
350 |
* @since 5.0.3 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
351 |
* @since 6.4.0 Added `$installed` parameter. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
352 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
353 |
* @param string $message The message being displayed. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
354 |
* @param WP_Post $post The post being edited. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
355 |
* @param bool $installed Whether the classic editor is installed. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
356 |
*/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
357 |
$message = apply_filters( 'block_editor_no_javascript_message', $message, $post, $installed ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
358 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
359 |
$message, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
360 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
361 |
'type' => 'error', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
362 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
363 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
364 |
?> |
9 | 365 |
</div> |
366 |
</div> |