Changeset 61019 for trunk/src/wp-includes/blocks.php
- Timestamp:
- 10/21/2025 11:30:43 AM (4 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/blocks.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r60999 r61019 176 176 $module_version = isset( $module_asset['version'] ) ? $module_asset['version'] : $block_version; 177 177 178 // Blocks using the Interactivity API are server-side rendered, so they are by design not in the critical rendering path and should be deprioritized. 178 $supports_interactivity_true = isset( $metadata['supports']['interactivity'] ) && true === $metadata['supports']['interactivity']; 179 $is_interactive = $supports_interactivity_true || ( isset( $metadata['supports']['interactivity']['interactive'] ) && true === $metadata['supports']['interactivity']['interactive'] ); 180 $supports_client_navigation = $supports_interactivity_true || ( isset( $metadata['supports']['interactivity']['clientNavigation'] ) && true === $metadata['supports']['interactivity']['clientNavigation'] ); 181 179 182 $args = array(); 180 if ( 181 ( isset( $metadata['supports']['interactivity'] ) && true === $metadata['supports']['interactivity'] ) ||182 ( isset( $metadata['supports']['interactivity']['interactive'] ) && true === $metadata['supports']['interactivity']['interactive'] )183 ) {183 184 // Blocks using the Interactivity API are server-side rendered, so they are 185 // by design not in the critical rendering path and should be deprioritized. 186 if ( $is_interactive ) { 184 187 $args['fetchpriority'] = 'low'; 185 188 $args['in_footer'] = true; 189 } 190 191 // Blocks using the Interactivity API that support client-side navigation 192 // must be marked as such in their script modules. 193 if ( $is_interactive && $supports_client_navigation ) { 194 wp_interactivity()->add_client_navigation_support_to_script_module( $module_id ); 186 195 } 187 196
Note: See TracChangeset
for help on using the changeset viewer.