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/site-editor.php

    r53197 r53404  
    6969    '__unstableHomeTemplate'   => $home_template,
    7070);
     71
     72// Add additional back-compat patterns registered by `current_screen` et al.
     73$custom_settings['__experimentalAdditionalBlockPatterns']          = WP_Block_Patterns_Registry::get_instance()->get_all_registered( true );
     74$custom_settings['__experimentalAdditionalBlockPatternCategories'] = WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered( true );
     75
    7176$editor_settings      = get_block_editor_settings( $custom_settings, $block_editor_context );
    7277
Note: See TracChangeset for help on using the changeset viewer.