mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Block Editor: Update @wordpress dependencies.
Changes of note: - Includes the new Annotations API package. - `wp-polyfill-ecmascript.js` is renamed to `wp-polyfill.js`. - `strip_dynamic_blocks()` has been removed in favor of `excerpt_remove_blocks()`. - The PHP block parser is now syncing from the `block-serialization-default-parser` package. - `do_blocks()` uses the new parser. - The `do_block` filter has been removed from `do_blocks()`, in favor of a `render_block` filter in `render_block()`. Also, a little cleanup to `render_block()`. Always normalize `$block['attrs’]` to array in `’render_block’` filter. Props pento, azaozz. Merges [43884] and [43888] to trunk. See #45145, #45190, #45264, #45282. git-svn-id: https://develop.svn.wordpress.org/trunk@44261 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -104,15 +104,9 @@ if ( 'auto-draft' === $post->post_status ) {
|
||||
$is_new_post = true;
|
||||
// Override "(Auto Draft)" new post default title with empty string, or filtered value.
|
||||
$initial_edits = array(
|
||||
'title' => array(
|
||||
'raw' => $post->post_title,
|
||||
),
|
||||
'content' => array(
|
||||
'raw' => $post->post_content,
|
||||
),
|
||||
'excerpt' => array(
|
||||
'raw' => $post->post_excerpt,
|
||||
),
|
||||
'title' => $post->post_title,
|
||||
'content' => $post->post_content,
|
||||
'excerpt' => $post->post_excerpt,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -203,8 +197,6 @@ if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) {
|
||||
}
|
||||
|
||||
// Image sizes.
|
||||
$image_sizes = get_intermediate_image_sizes();
|
||||
$image_sizes[] = 'full';
|
||||
|
||||
/** This filter is documented in wp-admin/includes/media.php */
|
||||
$image_size_names = apply_filters(
|
||||
@@ -218,10 +210,10 @@ $image_size_names = apply_filters(
|
||||
);
|
||||
|
||||
$available_image_sizes = array();
|
||||
foreach ( $image_sizes as $image_size_slug ) {
|
||||
foreach ( $image_size_names as $image_size_slug => $image_size_name ) {
|
||||
$available_image_sizes[] = array(
|
||||
'slug' => $image_size_slug,
|
||||
'name' => isset( $image_size_names[ $image_size_slug ] ) ? $image_size_names[ $image_size_slug ] : $image_size_slug,
|
||||
'name' => $image_size_name,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -260,10 +252,10 @@ if ( $user_id ) {
|
||||
*
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param string $text Placeholder text. Default 'Write your story'.
|
||||
* @param string $text Placeholder text. Default 'Start writing or type / to choose a block'.
|
||||
* @param WP_Post $post Post object.
|
||||
*/
|
||||
$body_placeholder = apply_filters( 'write_your_story', __( 'Write your story' ), $post );
|
||||
$body_placeholder = apply_filters( 'write_your_story', __( 'Start writing or type / to choose a block' ), $post );
|
||||
|
||||
$editor_settings = array(
|
||||
'alignWide' => $align_wide,
|
||||
@@ -280,7 +272,7 @@ $editor_settings = array(
|
||||
'maxUploadFileSize' => $max_upload_size,
|
||||
'allowedMimeTypes' => get_allowed_mime_types(),
|
||||
'styles' => $styles,
|
||||
'availableImageSizes' => $available_image_sizes,
|
||||
'imageSizes' => $available_image_sizes,
|
||||
'postLock' => $lock_details,
|
||||
'postLockUtils' => array(
|
||||
'nonce' => wp_create_nonce( 'lock-post_' . $post->ID ),
|
||||
|
||||
Reference in New Issue
Block a user