@@ -171,9 +171,9 @@ function register_block_script_module_id( $metadata, $field_name, $index = 0 ) {
171171 $ module_uri = get_block_asset_url ( $ module_path_norm );
172172
173173 $ module_asset = ! empty ( $ module_asset_path ) ? require $ module_asset_path : array ();
174- $ module_dependencies = isset ( $ module_asset ['dependencies ' ] ) ? $ module_asset [ ' dependencies ' ] : array ();
175- $ block_version = isset ( $ metadata ['version ' ] ) ? $ metadata [ ' version ' ] : false ;
176- $ module_version = isset ( $ module_asset ['version ' ] ) ? $ module_asset [ ' version ' ] : $ block_version ;
174+ $ module_dependencies = $ module_asset ['dependencies ' ] ?? array ();
175+ $ block_version = $ metadata ['version ' ] ?? false ;
176+ $ module_version = $ module_asset ['version ' ] ?? $ block_version ;
177177
178178 $ supports_interactivity_true = isset ( $ metadata ['supports ' ]['interactivity ' ] ) && true === $ metadata ['supports ' ]['interactivity ' ];
179179 $ is_interactive = $ supports_interactivity_true || ( isset ( $ metadata ['supports ' ]['interactivity ' ]['interactive ' ] ) && true === $ metadata ['supports ' ]['interactivity ' ]['interactive ' ] );
@@ -248,18 +248,17 @@ function register_block_script_handle( $metadata, $field_name, $index = 0 ) {
248248
249249 // Asset file for blocks is optional. See https://core.trac.wordpress.org/ticket/60460.
250250 $ script_asset = ! empty ( $ script_asset_path ) ? require $ script_asset_path : array ();
251- $ script_handle = isset ( $ script_asset ['handle ' ] ) ?
252- $ script_asset ['handle ' ] :
251+ $ script_handle = $ script_asset ['handle ' ] ??
253252 generate_block_asset_handle ( $ metadata ['name ' ], $ field_name , $ index );
254253 if ( wp_script_is ( $ script_handle , 'registered ' ) ) {
255254 return $ script_handle ;
256255 }
257256
258257 $ script_path_norm = wp_normalize_path ( realpath ( $ path . '/ ' . $ script_path ) );
259258 $ script_uri = get_block_asset_url ( $ script_path_norm );
260- $ script_dependencies = isset ( $ script_asset ['dependencies ' ] ) ? $ script_asset [ ' dependencies ' ] : array ();
261- $ block_version = isset ( $ metadata ['version ' ] ) ? $ metadata [ ' version ' ] : false ;
262- $ script_version = isset ( $ script_asset ['version ' ] ) ? $ script_asset [ ' version ' ] : $ block_version ;
259+ $ script_dependencies = $ script_asset ['dependencies ' ] ?? array ();
260+ $ block_version = $ metadata ['version ' ] ?? false ;
261+ $ script_version = $ script_asset ['version ' ] ?? $ block_version ;
263262 $ script_args = array ();
264263 if ( 'viewScript ' === $ field_name && $ script_uri ) {
265264 $ script_args ['strategy ' ] = 'defer ' ;
@@ -1068,9 +1067,7 @@ function set_ignored_hooked_blocks_metadata( &$parsed_anchor_block, $relative_po
10681067 }
10691068 }
10701069
1071- $ previously_ignored_hooked_blocks = isset ( $ parsed_anchor_block ['attrs ' ]['metadata ' ]['ignoredHookedBlocks ' ] )
1072- ? $ parsed_anchor_block ['attrs ' ]['metadata ' ]['ignoredHookedBlocks ' ]
1073- : array ();
1070+ $ previously_ignored_hooked_blocks = $ parsed_anchor_block ['attrs ' ]['metadata ' ]['ignoredHookedBlocks ' ] ?? array ();
10741071
10751072 $ parsed_anchor_block ['attrs ' ]['metadata ' ]['ignoredHookedBlocks ' ] = array_unique (
10761073 array_merge (
@@ -1404,9 +1401,7 @@ function update_ignored_hooked_blocks_postmeta( $post ) {
14041401 $ serialized_block = apply_block_hooks_to_content ( $ markup , $ context , 'set_ignored_hooked_blocks_metadata ' );
14051402 $ root_block = parse_blocks ( $ serialized_block )[0 ];
14061403
1407- $ ignored_hooked_blocks = isset ( $ root_block ['attrs ' ]['metadata ' ]['ignoredHookedBlocks ' ] )
1408- ? $ root_block ['attrs ' ]['metadata ' ]['ignoredHookedBlocks ' ]
1409- : array ();
1404+ $ ignored_hooked_blocks = $ root_block ['attrs ' ]['metadata ' ]['ignoredHookedBlocks ' ] ?? array ();
14101405
14111406 if ( ! empty ( $ ignored_hooked_blocks ) ) {
14121407 $ existing_ignored_hooked_blocks = get_post_meta ( $ post ->ID , '_wp_ignored_hooked_blocks ' , true );
@@ -1823,7 +1818,7 @@ function traverse_and_serialize_block( $block, $pre_callback = null, $post_callb
18231818 }
18241819
18251820 $ block_content .= traverse_and_serialize_block ( $ inner_block , $ pre_callback , $ post_callback );
1826- $ block_content .= isset ( $ post_markup ) ? $ post_markup : '' ;
1821+ $ block_content .= $ post_markup ?? '' ;
18271822
18281823 ++$ block_index ;
18291824 }
@@ -1983,7 +1978,7 @@ function traverse_and_serialize_blocks( $blocks, $pre_callback = null, $post_cal
19831978 }
19841979
19851980 $ result .= traverse_and_serialize_block ( $ block , $ pre_callback , $ post_callback );
1986- $ result .= isset ( $ post_markup ) ? $ post_markup : '' ;
1981+ $ result .= $ post_markup ?? '' ;
19871982 }
19881983
19891984 return $ result ;
@@ -2598,7 +2593,7 @@ function wp_migrate_old_typography_shape( $metadata ) {
25982593 );
25992594
26002595 foreach ( $ typography_keys as $ typography_key ) {
2601- $ support_for_key = isset ( $ metadata ['supports ' ][ $ typography_key ] ) ? $ metadata [ ' supports ' ][ $ typography_key ] : null ;
2596+ $ support_for_key = $ metadata ['supports ' ][ $ typography_key ] ?? null ;
26022597
26032598 if ( null !== $ support_for_key ) {
26042599 _doing_it_wrong (
0 commit comments