Make WordPress Core


Ignore:
Timestamp:
05/17/2022 02:36:22 PM (2 years ago)
Author:
gziolo
Message:

Editor: Return additional block patterns to server-generated settings

Reverts changes from [53155] to ensure backward compatibility.

Companion to Gutenberg changes https://github.com/WordPress/gutenberg/pull/40818. That makes sure that patterns registered with admin_init or current_screen hooks are not lost.

Props jsnajdr, zieladam, peterwilsoncc, johnstonphilip.
See #55567.

File:
1 edited

Legend:

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

    r53197 r53404  
    210210);
    211211
     212// Add additional back-compat patterns registered by `current_screen` et al.
     213$editor_settings['__experimentalAdditionalBlockPatterns']          = WP_Block_Patterns_Registry::get_instance()->get_all_registered( true );
     214$editor_settings['__experimentalAdditionalBlockPatternCategories'] = WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered( true );
     215
    212216$autosave = wp_get_post_autosave( $post->ID );
    213217if ( $autosave ) {
Note: See TracChangeset for help on using the changeset viewer.