Changeset 51089 for trunk/src/wp-includes/blocks/legacy-widget.php
- Timestamp:
- 06/08/2021 08:07:15 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/legacy-widget.php
r51051 r51089 51 51 52 52 /** 53 * On application init this does two things: 54 * 55 * - Registers the 'core/legacy-widget' block. 56 * - Intercepts any request with legacy-widget-preview in the query param and, 57 * if set, renders a page containing a preview of the requested Legacy Widget 58 * block. 53 * Registers the 'core/legacy-widget' block. 59 54 */ 60 function init_legacy_widget_block() {55 function register_block_core_legacy_widget() { 61 56 register_block_type_from_metadata( 62 57 __DIR__ . '/legacy-widget', … … 65 60 ) 66 61 ); 62 } 67 63 64 add_action( 'init', 'register_block_core_legacy_widget' ); 65 66 /** 67 * Intercepts any request with legacy-widget-preview in the query param and, if 68 * set, renders a page containing a preview of the requested Legacy Widget 69 * block. 70 */ 71 function handle_legacy_widget_preview_iframe() { 68 72 if ( empty( $_GET['legacy-widget-preview'] ) ) { 69 73 return; … … 111 115 } 112 116 113 add_action( 'init', 'init_legacy_widget_block' ); 117 // Ensure handle_legacy_widget_preview_iframe() is called after Core's 118 // register_block_core_legacy_widget() (priority = 10) and after Gutenberg's 119 // register_block_core_legacy_widget() (priority = 20). 120 add_action( 'init', 'handle_legacy_widget_preview_iframe', 21 );
Note: See TracChangeset
for help on using the changeset viewer.