Make WordPress Core


Ignore:
Timestamp:
12/17/2018 04:50:48 AM (6 years ago)
Author:
desrosj
Message:

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.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-admin/edit-form-blocks.php

    r44260 r44261  
    105105    // Override "(Auto Draft)" new post default title with empty string, or filtered value.
    106106    $initial_edits = array(
    107         'title'   => array(
    108             'raw' => $post->post_title,
    109         ),
    110         'content' => array(
    111             'raw' => $post->post_content,
    112         ),
    113         'excerpt' => array(
    114             'raw' => $post->post_excerpt,
    115         ),
     107        'title'   => $post->post_title,
     108        'content' => $post->post_content,
     109        'excerpt' => $post->post_excerpt,
    116110    );
    117111}
     
    204198
    205199// Image sizes.
    206 $image_sizes   = get_intermediate_image_sizes();
    207 $image_sizes[] = 'full';
    208200
    209201/** This filter is documented in wp-admin/includes/media.php */
     
    219211
    220212$available_image_sizes = array();
    221 foreach ( $image_sizes as $image_size_slug ) {
     213foreach ( $image_size_names as $image_size_slug => $image_size_name ) {
    222214    $available_image_sizes[] = array(
    223215        'slug' => $image_size_slug,
    224         'name' => isset( $image_size_names[ $image_size_slug ] ) ? $image_size_names[ $image_size_slug ] : $image_size_slug,
     216        'name' => $image_size_name,
    225217    );
    226218}
     
    261253 * @since 5.0.0
    262254 *
    263  * @param string  $text Placeholder text. Default 'Write your story'.
     255 * @param string  $text Placeholder text. Default 'Start writing or type / to choose a block'.
    264256 * @param WP_Post $post Post object.
    265257 */
    266 $body_placeholder = apply_filters( 'write_your_story', __( 'Write your story' ), $post );
     258$body_placeholder = apply_filters( 'write_your_story', __( 'Start writing or type / to choose a block' ), $post );
    267259
    268260$editor_settings = array(
     
    281273    'allowedMimeTypes'       => get_allowed_mime_types(),
    282274    'styles'                 => $styles,
    283     'availableImageSizes'    => $available_image_sizes,
     275    'imageSizes'             => $available_image_sizes,
    284276    'postLock'               => $lock_details,
    285277    'postLockUtils'          => array(
Note: See TracChangeset for help on using the changeset viewer.