Changeset 59238 for trunk/src/wp-admin/widgets-form-blocks.php
- Timestamp:
- 10/15/2024 08:50:08 AM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/widgets-form-blocks.php
r56671 r59238 51 51 'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');' 52 52 ); 53 54 // Preload server-registered block bindings sources. 55 $registered_sources = get_all_registered_block_bindings_sources(); 56 if ( ! empty( $registered_sources ) ) { 57 $filtered_sources = array(); 58 foreach ( $registered_sources as $source ) { 59 $filtered_sources[] = array( 60 'name' => $source->name, 61 'label' => $source->label, 62 'usesContext' => $source->uses_context, 63 ); 64 } 65 $script = sprintf( 'for ( const source of %s ) { wp.blocks.registerBlockBindingsSource( source ); }', wp_json_encode( $filtered_sources ) ); 66 wp_add_inline_script( 67 'wp-blocks', 68 $script 69 ); 70 } 53 71 54 72 wp_add_inline_script(
Note: See TracChangeset
for help on using the changeset viewer.