Changeset 61431
- Timestamp:
- 01/05/2026 05:22:14 AM (3 months ago)
- Location:
- trunk/src
- Files:
-
- 12 edited
-
wp-admin/edit-form-advanced.php (modified) (1 diff)
-
wp-admin/site-editor.php (modified) (1 diff)
-
wp-includes/block-editor.php (modified) (2 diffs)
-
wp-includes/block-template-utils.php (modified) (3 diffs)
-
wp-includes/block-template.php (modified) (1 diff)
-
wp-includes/blocks.php (modified) (8 diffs)
-
wp-includes/class-wp-block-metadata-registry.php (modified) (1 diff)
-
wp-includes/class-wp-block-templates-registry.php (modified) (1 diff)
-
wp-includes/class-wp-block-type.php (modified) (1 diff)
-
wp-includes/class-wp-block.php (modified) (2 diffs)
-
wp-includes/class-wp-classic-to-block-menu-converter.php (modified) (1 diff)
-
wp-includes/class-wp-theme-json.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-form-advanced.php
r60043 r61431 70 70 $post_ID = isset( $post_ID ) ? (int) $post_ID : 0; 71 71 $user_ID = isset( $user_ID ) ? (int) $user_ID : 0; 72 $action = isset( $action ) ? $action :'';72 $action = $action ?? ''; 73 73 74 74 if ( (int) get_option( 'page_for_posts' ) === $post->ID && empty( $post->post_content ) ) { -
trunk/src/wp-admin/site-editor.php
r61178 r61431 288 288 wp_add_inline_script( 289 289 'wp-blocks', 290 sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( isset( $editor_settings['blockCategories'] ) ? $editor_settings['blockCategories'] :array(), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ),290 sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( $editor_settings['blockCategories'] ?? array(), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ), 291 291 'after' 292 292 ); -
trunk/src/wp-includes/block-editor.php
r60807 r61431 567 567 if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) { 568 568 $colors_by_origin = $editor_settings['__experimentalFeatures']['color']['palette']; 569 $editor_settings['colors'] = isset( $colors_by_origin['custom'] ) ? 570 $colors_by_origin['custom'] : ( 571 isset( $colors_by_origin['theme'] ) ? 572 $colors_by_origin['theme'] : 573 $colors_by_origin['default'] 574 ); 569 $editor_settings['colors'] = $colors_by_origin['custom'] ?? $colors_by_origin['theme'] ?? $colors_by_origin['default']; 575 570 } 576 571 if ( isset( $editor_settings['__experimentalFeatures']['color']['gradients'] ) ) { 577 572 $gradients_by_origin = $editor_settings['__experimentalFeatures']['color']['gradients']; 578 $editor_settings['gradients'] = isset( $gradients_by_origin['custom'] ) ? 579 $gradients_by_origin['custom'] : ( 580 isset( $gradients_by_origin['theme'] ) ? 581 $gradients_by_origin['theme'] : 582 $gradients_by_origin['default'] 583 ); 573 $editor_settings['gradients'] = $gradients_by_origin['custom'] ?? $gradients_by_origin['theme'] ?? $gradients_by_origin['default']; 584 574 } 585 575 if ( isset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ) ) { 586 576 $font_sizes_by_origin = $editor_settings['__experimentalFeatures']['typography']['fontSizes']; 587 $editor_settings['fontSizes'] = isset( $font_sizes_by_origin['custom'] ) ? 588 $font_sizes_by_origin['custom'] : ( 589 isset( $font_sizes_by_origin['theme'] ) ? 590 $font_sizes_by_origin['theme'] : 591 $font_sizes_by_origin['default'] 592 ); 577 $editor_settings['fontSizes'] = $font_sizes_by_origin['custom'] ?? $font_sizes_by_origin['theme'] ?? $font_sizes_by_origin['default']; 593 578 } 594 579 if ( isset( $editor_settings['__experimentalFeatures']['color']['custom'] ) ) { … … 623 608 if ( isset( $editor_settings['__experimentalFeatures']['spacing']['spacingSizes'] ) ) { 624 609 $spacing_sizes_by_origin = $editor_settings['__experimentalFeatures']['spacing']['spacingSizes']; 625 $editor_settings['spacingSizes'] = isset( $spacing_sizes_by_origin['custom'] ) ? 626 $spacing_sizes_by_origin['custom'] : ( 627 isset( $spacing_sizes_by_origin['theme'] ) ? 628 $spacing_sizes_by_origin['theme'] : 629 $spacing_sizes_by_origin['default'] 630 ); 610 $editor_settings['spacingSizes'] = $spacing_sizes_by_origin['custom'] ?? $spacing_sizes_by_origin['theme'] ?? $spacing_sizes_by_origin['default']; 631 611 } 632 612 -
trunk/src/wp-includes/block-template-utils.php
r61178 r61431 383 383 384 384 // Prepare metadata from $query. 385 $slugs_to_include = isset( $query['slug__in'] ) ? $query['slug__in'] :array();386 $slugs_to_skip = isset( $query['slug__not_in'] ) ? $query['slug__not_in'] :array();387 $area = isset( $query['area'] ) ? $query['area'] :null;388 $post_type = isset( $query['post_type'] ) ? $query['post_type'] :'';385 $slugs_to_include = $query['slug__in'] ?? array(); 386 $slugs_to_skip = $query['slug__not_in'] ?? array(); 387 $area = $query['area'] ?? null; 388 $post_type = $query['post_type'] ?? ''; 389 389 390 390 $stylesheet = get_stylesheet(); … … 1116 1116 } 1117 1117 1118 $post_type = isset( $query['post_type'] ) ? $query['post_type'] :'';1118 $post_type = $query['post_type'] ?? ''; 1119 1119 $wp_query_args = array( 1120 1120 'post_status' => array( 'auto-draft', 'draft', 'publish' ), … … 1703 1703 } 1704 1704 1705 $meta = isset( $changes->meta_input ) ? $changes->meta_input :array();1706 $terms = isset( $changes->tax_input ) ? $changes->tax_input :array();1705 $meta = $changes->meta_input ?? array(); 1706 $terms = $changes->tax_input ?? array(); 1707 1707 1708 1708 if ( empty( $changes->ID ) ) { -
trunk/src/wp-includes/block-template.php
r61178 r61431 374 374 375 375 // Pages. 376 $page_id = isset( $wp_query->query['page_id'] ) ? $wp_query->query['page_id'] :null;376 $page_id = $wp_query->query['page_id'] ?? null; 377 377 378 378 // Posts, including custom post types. 379 $p = isset( $wp_query->query['p'] ) ? $wp_query->query['p'] :null;379 $p = $wp_query->query['p'] ?? null; 380 380 381 381 $post_id = $page_id ? $page_id : $p; -
trunk/src/wp-includes/blocks.php
r61019 r61431 172 172 173 173 $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; 177 177 178 178 $supports_interactivity_true = isset( $metadata['supports']['interactivity'] ) && true === $metadata['supports']['interactivity']; … … 249 249 // Asset file for blocks is optional. See https://core.trac.wordpress.org/ticket/60460. 250 250 $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'] ?? 253 252 generate_block_asset_handle( $metadata['name'], $field_name, $index ); 254 253 if ( wp_script_is( $script_handle, 'registered' ) ) { … … 258 257 $script_path_norm = wp_normalize_path( realpath( $path . '/' . $script_path ) ); 259 258 $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; 263 262 $script_args = array(); 264 263 if ( 'viewScript' === $field_name && $script_uri ) { … … 1069 1068 } 1070 1069 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(); 1074 1071 1075 1072 $parsed_anchor_block['attrs']['metadata']['ignoredHookedBlocks'] = array_unique( … … 1405 1402 $root_block = parse_blocks( $serialized_block )[0]; 1406 1403 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(); 1410 1405 1411 1406 if ( ! empty( $ignored_hooked_blocks ) ) { … … 1824 1819 1825 1820 $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 ?? ''; 1827 1822 1828 1823 ++$block_index; … … 1984 1979 1985 1980 $result .= traverse_and_serialize_block( $block, $pre_callback, $post_callback ); 1986 $result .= isset( $post_markup ) ? $post_markup :'';1981 $result .= $post_markup ?? ''; 1987 1982 } 1988 1983 … … 2599 2594 2600 2595 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; 2602 2597 2603 2598 if ( null !== $support_for_key ) { -
trunk/src/wp-includes/class-wp-block-metadata-registry.php
r59938 r61431 179 179 $block_name = self::default_identifier_callback( $file_or_folder ); 180 180 181 return isset( $collection['metadata'][ $block_name ] ) ? $collection['metadata'][ $block_name ] :null;181 return $collection['metadata'][ $block_name ] ?? null; 182 182 } 183 183 -
trunk/src/wp-includes/class-wp-block-templates-registry.php
r61090 r61431 76 76 $template->plugin = $plugin; 77 77 $template->author = null; 78 $template->content = isset( $args['content'] ) ? $args['content'] :'';78 $template->content = $args['content'] ?? ''; 79 79 $template->source = 'plugin'; 80 80 $template->slug = $slug; 81 81 $template->type = 'wp_template'; 82 $template->title = isset( $args['title'] ) ? $args['title'] :$template_name;83 $template->description = isset( $args['description'] ) ? $args['description'] :'';82 $template->title = $args['title'] ?? $template_name; 83 $template->description = $args['description'] ?? ''; 84 84 $template->status = 'publish'; 85 85 $template->origin = 'plugin'; 86 86 $template->is_custom = ! isset( $default_template_types[ $template_name ] ); 87 $template->post_types = isset( $args['post_types'] ) ? $args['post_types'] :array();87 $template->post_types = $args['post_types'] ?? array(); 88 88 } 89 89 -
trunk/src/wp-includes/class-wp-block-type.php
r58073 r61431 384 384 return $this->{$new_name}; 385 385 } 386 return isset( $this->{$new_name}[0] ) ? $this->{$new_name}[0] :null;386 return $this->{$new_name}[0] ?? null; 387 387 } 388 388 -
trunk/src/wp-includes/class-wp-block.php
r60983 r61431 223 223 public function __get( $name ) { 224 224 if ( 'attributes' === $name ) { 225 $this->attributes = isset( $this->parsed_block['attrs'] ) ? 226 $this->parsed_block['attrs'] : 225 $this->attributes = $this->parsed_block['attrs'] ?? 227 226 array(); 228 227 … … 313 312 foreach ( $supported_block_attributes as $attribute_name ) { 314 313 // Retain any non-pattern override bindings that might be present. 315 $updated_bindings[ $attribute_name ] = isset( $bindings[ $attribute_name ] ) 316 ? $bindings[ $attribute_name ] 317 : array( 'source' => 'core/pattern-overrides' ); 314 $updated_bindings[ $attribute_name ] = $bindings[ $attribute_name ] ?? array( 'source' => 'core/pattern-overrides' ); 318 315 } 319 316 $bindings = $updated_bindings; -
trunk/src/wp-includes/class-wp-classic-to-block-menu-converter.php
r60325 r61431 45 45 $menu_items_by_parent_id = static::group_by_parent_id( $menu_items ); 46 46 47 $first_menu_item = isset( $menu_items_by_parent_id[0] ) 48 ? $menu_items_by_parent_id[0] 49 : array(); 47 $first_menu_item = $menu_items_by_parent_id[0] ?? array(); 50 48 51 49 $inner_blocks = static::to_blocks( -
trunk/src/wp-includes/class-wp-theme-json.php
r61190 r61431 1205 1205 // Keep backwards compatibility for support.color.__experimentalDuotone. 1206 1206 if ( null === $duotone_selector ) { 1207 $duotone_support = isset( $block_type->supports['color']['__experimentalDuotone'] ) 1208 ? $block_type->supports['color']['__experimentalDuotone'] 1209 : null; 1207 $duotone_support = $block_type->supports['color']['__experimentalDuotone'] ?? null; 1210 1208 1211 1209 if ( $duotone_support ) { … … 1521 1519 _deprecated_function( __METHOD__, '6.7.0', 'get_stylesheet' ); 1522 1520 // Add the global styles root CSS. 1523 $stylesheet = isset( $this->theme_json['styles']['css'] ) ? $this->theme_json['styles']['css'] :'';1521 $stylesheet = $this->theme_json['styles']['css'] ?? ''; 1524 1522 1525 1523 // Add the global styles block CSS. 1526 1524 if ( isset( $this->theme_json['styles']['blocks'] ) ) { 1527 1525 foreach ( $this->theme_json['styles']['blocks'] as $name => $node ) { 1528 $custom_block_css = isset( $this->theme_json['styles']['blocks'][ $name ]['css'] ) 1529 ? $this->theme_json['styles']['blocks'][ $name ]['css'] 1530 : null; 1526 $custom_block_css = $this->theme_json['styles']['blocks'][ $name ]['css'] ?? null; 1531 1527 if ( $custom_block_css ) { 1532 1528 $selector = static::$blocks_metadata[ $name ]['selector']; … … 1555 1551 if ( isset( $item['name'] ) ) { 1556 1552 $custom_templates[ $item['name'] ] = array( 1557 'title' => isset( $item['title'] ) ? $item['title'] :'',1558 'postTypes' => isset( $item['postTypes'] ) ? $item['postTypes'] :array( 'page' ),1553 'title' => $item['title'] ?? '', 1554 'postTypes' => $item['postTypes'] ?? array( 'page' ), 1559 1555 ); 1560 1556 } … … 1579 1575 if ( isset( $item['name'] ) ) { 1580 1576 $template_parts[ $item['name'] ] = array( 1581 'title' => isset( $item['title'] ) ? $item['title'] :'',1582 'area' => isset( $item['area'] ) ? $item['area'] :'',1577 'title' => $item['title'] ?? '', 1578 'area' => $item['area'] ?? '', 1583 1579 ); 1584 1580 } … … 1650 1646 } 1651 1647 1652 $selector = isset( $block_metadata['selector'] ) ? $block_metadata['selector'] :'';1648 $selector = $block_metadata['selector'] ?? ''; 1653 1649 $has_block_gap_support = isset( $this->theme_json['settings']['spacing']['blockGap'] ); 1654 1650 $has_fallback_gap_support = ! $has_block_gap_support; // This setting isn't useful yet: it exists as a placeholder for a future explicit fallback gap styles support. … … 1667 1663 $block_gap_value = static::ROOT_BLOCK_SELECTOR === $selector ? '0.5em' : null; 1668 1664 if ( ! empty( $block_type ) ) { 1669 $block_gap_value = isset( $block_type->supports['spacing']['blockGap']['__experimentalDefault'] ) 1670 ? $block_type->supports['spacing']['blockGap']['__experimentalDefault'] 1671 : null; 1665 $block_gap_value = $block_type->supports['spacing']['blockGap']['__experimentalDefault'] ?? null; 1672 1666 } 1673 1667 } else { … … 1695 1689 } 1696 1690 1697 $class_name = isset( $layout_definition['className'] ) ? $layout_definition['className'] :false;1698 $spacing_rules = isset( $layout_definition['spacingStyles'] ) ? $layout_definition['spacingStyles'] :array();1691 $class_name = $layout_definition['className'] ?? false; 1692 $spacing_rules = $layout_definition['spacingStyles'] ?? array(); 1699 1693 1700 1694 if ( … … 1752 1746 $valid_display_modes = array( 'block', 'flex', 'grid' ); 1753 1747 foreach ( $layout_definitions as $layout_definition ) { 1754 $class_name = isset( $layout_definition['className'] ) ? $layout_definition['className'] :false;1755 $base_style_rules = isset( $layout_definition['baseStyles'] ) ? $layout_definition['baseStyles'] :array();1748 $class_name = $layout_definition['className'] ?? false; 1749 $base_style_rules = $layout_definition['baseStyles'] ?? array(); 1756 1750 1757 1751 if ( … … 2235 2229 protected static function compute_theme_vars( $settings ) { 2236 2230 $declarations = array(); 2237 $custom_values = isset( $settings['custom'] ) ? $settings['custom'] :array();2231 $custom_values = $settings['custom'] ?? array(); 2238 2232 $css_vars = static::flatten_tree( $custom_values ); 2239 2233 foreach ( $css_vars as $key => $value ) { … … 2845 2839 $use_root_padding = isset( $this->theme_json['settings']['useRootPaddingAwareAlignments'] ) && true === $this->theme_json['settings']['useRootPaddingAwareAlignments']; 2846 2840 $selector = $block_metadata['selector']; 2847 $settings = isset( $this->theme_json['settings'] ) ? $this->theme_json['settings'] :array();2841 $settings = $this->theme_json['settings'] ?? array(); 2848 2842 $feature_declarations = static::get_feature_declarations_for_node( $block_metadata, $node ); 2849 2843 $is_root_selector = static::ROOT_BLOCK_SELECTOR === $selector; … … 2926 2920 ); 2927 2921 2928 $pseudo_selector = isset( $pseudo_matches[0] ) ? $pseudo_matches[0] :null;2922 $pseudo_selector = $pseudo_matches[0] ?? null; 2929 2923 2930 2924 /* … … 3069 3063 public function get_root_layout_rules( $selector, $block_metadata ) { 3070 3064 $css = ''; 3071 $settings = isset( $this->theme_json['settings'] ) ? $this->theme_json['settings'] :array();3065 $settings = $this->theme_json['settings'] ?? array(); 3072 3066 $use_root_padding = isset( $this->theme_json['settings']['useRootPaddingAwareAlignments'] ) && true === $this->theme_json['settings']['useRootPaddingAwareAlignments']; 3073 3067 … … 3077 3071 */ 3078 3072 if ( isset( $settings['layout']['contentSize'] ) || isset( $settings['layout']['wideSize'] ) ) { 3079 $content_size = isset( $settings['layout']['contentSize'] ) ? $settings['layout']['contentSize'] :$settings['layout']['wideSize'];3073 $content_size = $settings['layout']['contentSize'] ?? $settings['layout']['wideSize']; 3080 3074 $content_size = static::is_safe_css_declaration( 'max-width', $content_size ) ? $content_size : 'initial'; 3081 $wide_size = isset( $settings['layout']['wideSize'] ) ? $settings['layout']['wideSize'] :$settings['layout']['contentSize'];3075 $wide_size = $settings['layout']['wideSize'] ?? $settings['layout']['contentSize']; 3082 3076 $wide_size = static::is_safe_css_declaration( 'max-width', $wide_size ) ? $wide_size : 'initial'; 3083 3077 $css .= static::ROOT_CSS_PROPERTIES_SELECTOR . ' { --wp--style--global--content-size: ' . $content_size . ';'; … … 4066 4060 _deprecated_function( __METHOD__, '6.6.0' ); 4067 4061 4068 $spacing_scale = isset( $this->theme_json['settings']['spacing']['spacingScale'] ) 4069 ? $this->theme_json['settings']['spacing']['spacingScale'] 4070 : array(); 4062 $spacing_scale = $this->theme_json['settings']['spacing']['spacingScale'] ?? array(); 4071 4063 4072 4064 if ( ! isset( $spacing_scale['steps'] ) … … 4402 4394 } 4403 4395 4404 $settings = isset( $this->theme_json['settings'] ) 4405 ? $this->theme_json['settings'] 4406 : array(); 4396 $settings = $this->theme_json['settings'] ?? array(); 4407 4397 4408 4398 foreach ( $metadata['selectors'] as $feature => $feature_selectors ) { … … 4533 4523 ), 4534 4524 array( 4535 isset( $values[ $key_in_values ] ) ? $values[ $key_in_values ] :$rule_to_replace,4536 isset( $values[ $fallback ] ) ? $values[ $fallback ] :$fallback,4525 $values[ $key_in_values ] ?? $rule_to_replace, 4526 $values[ $fallback ] ?? $fallback, 4537 4527 ), 4538 4528 $resolved_style
Note: See TracChangeset
for help on using the changeset viewer.