Changeset 63368
- Timestamp:
- 08/27/2026 08:02:54 PM (6 weeks ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
src/wp-includes/class-wp-classic-to-block-menu-converter.php (modified) (2 diffs)
-
src/wp-includes/class-wp-navigation-fallback.php (modified) (7 diffs)
-
src/wp-includes/class-wp-theme-json-resolver.php (modified) (5 diffs)
-
src/wp-includes/fonts/class-wp-font-face-resolver.php (modified) (5 diffs)
-
tests/phpstan/baselines/staticClassAccess.privateMethod.neon (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-classic-to-block-menu-converter.php
r61431 r63368 43 43 _wp_menu_item_classes_by_context( $menu_items ); 44 44 45 $menu_items_by_parent_id = s tatic::group_by_parent_id( $menu_items );45 $menu_items_by_parent_id = self::group_by_parent_id( $menu_items ); 46 46 47 47 $first_menu_item = $menu_items_by_parent_id[0] ?? array(); 48 48 49 $inner_blocks = s tatic::to_blocks(49 $inner_blocks = self::to_blocks( 50 50 $first_menu_item, 51 51 $menu_items_by_parent_id … … 118 118 119 119 $block['innerBlocks'] = isset( $menu_items_by_parent_id[ $menu_item->ID ] ) 120 ? s tatic::to_blocks( $menu_items_by_parent_id[ $menu_item->ID ], $menu_items_by_parent_id )120 ? self::to_blocks( $menu_items_by_parent_id[ $menu_item->ID ], $menu_items_by_parent_id ) 121 121 : array(); 122 122 $block['innerContent'] = array_map( 'serialize_block', $block['innerBlocks'] ); -
trunk/src/wp-includes/class-wp-navigation-fallback.php
r60325 r63368 78 78 $should_create_fallback = apply_filters( 'wp_navigation_should_create_fallback', true ); 79 79 80 $fallback = s tatic::get_most_recently_published_navigation();80 $fallback = self::get_most_recently_published_navigation(); 81 81 82 82 if ( $fallback || ! $should_create_fallback ) { … … 84 84 } 85 85 86 $fallback = s tatic::create_classic_menu_fallback();86 $fallback = self::create_classic_menu_fallback(); 87 87 88 88 if ( $fallback && ! is_wp_error( $fallback ) ) { 89 89 // Return the newly created fallback post object which will now be the most recently created navigation menu. 90 return $fallback instanceof WP_Post ? $fallback : s tatic::get_most_recently_published_navigation();91 } 92 93 $fallback = s tatic::create_default_fallback();90 return $fallback instanceof WP_Post ? $fallback : self::get_most_recently_published_navigation(); 91 } 92 93 $fallback = self::create_default_fallback(); 94 94 95 95 if ( $fallback && ! is_wp_error( $fallback ) ) { 96 96 // Return the newly created fallback post object which will now be the most recently created navigation menu. 97 return $fallback instanceof WP_Post ? $fallback : s tatic::get_most_recently_published_navigation();97 return $fallback instanceof WP_Post ? $fallback : self::get_most_recently_published_navigation(); 98 98 } 99 99 … … 139 139 private static function create_classic_menu_fallback() { 140 140 // See if we have a classic menu. 141 $classic_nav_menu = s tatic::get_fallback_classic_menu();141 $classic_nav_menu = self::get_fallback_classic_menu(); 142 142 143 143 if ( ! $classic_nav_menu ) { … … 185 185 } 186 186 187 $nav_menu = s tatic::get_nav_menu_at_primary_location();187 $nav_menu = self::get_nav_menu_at_primary_location(); 188 188 189 189 if ( $nav_menu ) { … … 191 191 } 192 192 193 $nav_menu = s tatic::get_nav_menu_with_primary_slug( $classic_nav_menus );193 $nav_menu = self::get_nav_menu_with_primary_slug( $classic_nav_menus ); 194 194 195 195 if ( $nav_menu ) { … … 197 197 } 198 198 199 return s tatic::get_most_recently_created_nav_menu( $classic_nav_menus );199 return self::get_most_recently_created_nav_menu( $classic_nav_menus ); 200 200 } 201 201 … … 270 270 private static function create_default_fallback() { 271 271 272 $default_blocks = s tatic::get_default_fallback_blocks();272 $default_blocks = self::get_default_fallback_blocks(); 273 273 274 274 // Create a new navigation menu from the fallback blocks. -
trunk/src/wp-includes/class-wp-theme-json-resolver.php
r61637 r63368 280 280 * 281 281 */ 282 $theme_json_data = s tatic::inject_variations_from_block_style_variation_files( $theme_json_data, $variations );283 $theme_json_data = s tatic::inject_variations_from_block_styles_registry( $theme_json_data );282 $theme_json_data = self::inject_variations_from_block_style_variation_files( $theme_json_data, $variations ); 283 $theme_json_data = self::inject_variations_from_block_styles_registry( $theme_json_data ); 284 284 285 285 /** … … 401 401 foreach ( $blocks as $block_name => $block_type ) { 402 402 if ( isset( $block_type->supports['__experimentalStyle'] ) ) { 403 $config['styles']['blocks'][ $block_name ] = s tatic::remove_json_comments( $block_type->supports['__experimentalStyle'] );403 $config['styles']['blocks'][ $block_name ] = self::remove_json_comments( $block_type->supports['__experimentalStyle'] ); 404 404 } 405 405 … … 451 451 foreach ( $input_array as $k => $v ) { 452 452 if ( is_array( $v ) ) { 453 $input_array[ $k ] = s tatic::remove_json_comments( $v );453 $input_array[ $k ] = self::remove_json_comments( $v ); 454 454 } 455 455 } … … 806 806 $template_directory = get_template_directory() . '/styles'; 807 807 if ( is_dir( $base_directory ) ) { 808 $variation_files = s tatic::recursively_iterate_json( $base_directory );808 $variation_files = self::recursively_iterate_json( $base_directory ); 809 809 } 810 810 if ( is_dir( $template_directory ) && $template_directory !== $base_directory ) { 811 $variation_files_parent = s tatic::recursively_iterate_json( $template_directory );811 $variation_files_parent = self::recursively_iterate_json( $template_directory ); 812 812 // If the child and parent variation file basename are the same, only include the child theme's. 813 813 foreach ( $variation_files_parent as $parent_path => $parent ) { … … 823 823 foreach ( $variation_files as $path => $file ) { 824 824 $decoded_file = self::read_json_file( $path ); 825 if ( is_array( $decoded_file ) && s tatic::style_variation_has_scope( $decoded_file, $scope ) ) {825 if ( is_array( $decoded_file ) && self::style_variation_has_scope( $decoded_file, $scope ) ) { 826 826 $translated = static::translate( $decoded_file, wp_get_theme()->get( 'TextDomain' ) ); 827 827 $variation = ( new WP_Theme_JSON( $translated ) )->get_raw_data(); -
trunk/src/wp-includes/fonts/class-wp-font-face-resolver.php
r59260 r63368 34 34 } 35 35 36 return s tatic::parse_settings( $settings );36 return self::parse_settings( $settings ); 37 37 } 38 38 … … 66 66 ); 67 67 68 return s tatic::parse_settings( $settings );68 return self::parse_settings( $settings ); 69 69 } 70 70 … … 93 93 } 94 94 95 $font_family_name = s tatic::maybe_parse_name_from_comma_separated_list( $definition['fontFamily'] );95 $font_family_name = self::maybe_parse_name_from_comma_separated_list( $definition['fontFamily'] ); 96 96 97 97 // Skip if no font family is defined. … … 100 100 } 101 101 102 $fonts[] = s tatic::convert_font_face_properties( $definition['fontFace'], $font_family_name );102 $fonts[] = self::convert_font_face_properties( $definition['fontFace'], $font_family_name ); 103 103 } 104 104 } … … 144 144 // Converts the "file:./" src placeholder into a theme font file URI. 145 145 if ( ! empty( $font_face['src'] ) ) { 146 $font_face['src'] = s tatic::to_theme_file_uri( (array) $font_face['src'] );146 $font_face['src'] = self::to_theme_file_uri( (array) $font_face['src'] ); 147 147 } 148 148 149 149 // Convert camelCase properties into kebab-case. 150 $font_face = s tatic::to_kebab_case( $font_face );150 $font_face = self::to_kebab_case( $font_face ); 151 151 152 152 $converted_font_faces[] = $font_face; -
trunk/tests/phpstan/baselines/staticClassAccess.privateMethod.neon
r63020 r63368 19 19 parameters: 20 20 ignoreErrors: 21 -22 message: '#^Unsafe call to private method WP_Classic_To_Block_Menu_Converter\:\:group_by_parent_id\(\) through static\:\:\.$#'23 identifier: staticClassAccess.privateMethod24 count: 125 path: ../../../src/wp-includes/class-wp-classic-to-block-menu-converter.php26 -27 message: '#^Unsafe call to private method WP_Classic_To_Block_Menu_Converter\:\:to_blocks\(\) through static\:\:\.$#'28 identifier: staticClassAccess.privateMethod29 count: 230 path: ../../../src/wp-includes/class-wp-classic-to-block-menu-converter.php31 -32 message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:create_classic_menu_fallback\(\) through static\:\:\.$#'33 identifier: staticClassAccess.privateMethod34 count: 135 path: ../../../src/wp-includes/class-wp-navigation-fallback.php36 -37 message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:create_default_fallback\(\) through static\:\:\.$#'38 identifier: staticClassAccess.privateMethod39 count: 140 path: ../../../src/wp-includes/class-wp-navigation-fallback.php41 -42 message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:get_default_fallback_blocks\(\) through static\:\:\.$#'43 identifier: staticClassAccess.privateMethod44 count: 145 path: ../../../src/wp-includes/class-wp-navigation-fallback.php46 -47 message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:get_fallback_classic_menu\(\) through static\:\:\.$#'48 identifier: staticClassAccess.privateMethod49 count: 150 path: ../../../src/wp-includes/class-wp-navigation-fallback.php51 -52 message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:get_most_recently_created_nav_menu\(\) through static\:\:\.$#'53 identifier: staticClassAccess.privateMethod54 count: 155 path: ../../../src/wp-includes/class-wp-navigation-fallback.php56 -57 message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:get_most_recently_published_navigation\(\) through static\:\:\.$#'58 identifier: staticClassAccess.privateMethod59 count: 360 path: ../../../src/wp-includes/class-wp-navigation-fallback.php61 -62 message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:get_nav_menu_at_primary_location\(\) through static\:\:\.$#'63 identifier: staticClassAccess.privateMethod64 count: 165 path: ../../../src/wp-includes/class-wp-navigation-fallback.php66 -67 message: '#^Unsafe call to private method WP_Navigation_Fallback\:\:get_nav_menu_with_primary_slug\(\) through static\:\:\.$#'68 identifier: staticClassAccess.privateMethod69 count: 170 path: ../../../src/wp-includes/class-wp-navigation-fallback.php71 -72 message: '#^Unsafe call to private method WP_Theme_JSON_Resolver\:\:inject_variations_from_block_style_variation_files\(\) through static\:\:\.$#'73 identifier: staticClassAccess.privateMethod74 count: 175 path: ../../../src/wp-includes/class-wp-theme-json-resolver.php76 -77 message: '#^Unsafe call to private method WP_Theme_JSON_Resolver\:\:inject_variations_from_block_styles_registry\(\) through static\:\:\.$#'78 identifier: staticClassAccess.privateMethod79 count: 180 path: ../../../src/wp-includes/class-wp-theme-json-resolver.php81 -82 message: '#^Unsafe call to private method WP_Theme_JSON_Resolver\:\:recursively_iterate_json\(\) through static\:\:\.$#'83 identifier: staticClassAccess.privateMethod84 count: 285 path: ../../../src/wp-includes/class-wp-theme-json-resolver.php86 -87 message: '#^Unsafe call to private method WP_Theme_JSON_Resolver\:\:remove_json_comments\(\) through static\:\:\.$#'88 identifier: staticClassAccess.privateMethod89 count: 290 path: ../../../src/wp-includes/class-wp-theme-json-resolver.php91 -92 message: '#^Unsafe call to private method WP_Theme_JSON_Resolver\:\:style_variation_has_scope\(\) through static\:\:\.$#'93 identifier: staticClassAccess.privateMethod94 count: 195 path: ../../../src/wp-includes/class-wp-theme-json-resolver.php96 21 - 97 22 message: '#^Unsafe call to private method WP_Theme_JSON\:\:compute_spacing_sizes\(\) through static\:\:\.$#' … … 164 89 count: 1 165 90 path: ../../../src/wp-includes/class-wp-theme-json.php 166 -167 message: '#^Unsafe call to private method WP_Font_Face_Resolver\:\:convert_font_face_properties\(\) through static\:\:\.$#'168 identifier: staticClassAccess.privateMethod169 count: 1170 path: ../../../src/wp-includes/fonts/class-wp-font-face-resolver.php171 -172 message: '#^Unsafe call to private method WP_Font_Face_Resolver\:\:maybe_parse_name_from_comma_separated_list\(\) through static\:\:\.$#'173 identifier: staticClassAccess.privateMethod174 count: 1175 path: ../../../src/wp-includes/fonts/class-wp-font-face-resolver.php176 -177 message: '#^Unsafe call to private method WP_Font_Face_Resolver\:\:parse_settings\(\) through static\:\:\.$#'178 identifier: staticClassAccess.privateMethod179 count: 2180 path: ../../../src/wp-includes/fonts/class-wp-font-face-resolver.php181 -182 message: '#^Unsafe call to private method WP_Font_Face_Resolver\:\:to_kebab_case\(\) through static\:\:\.$#'183 identifier: staticClassAccess.privateMethod184 count: 1185 path: ../../../src/wp-includes/fonts/class-wp-font-face-resolver.php186 -187 message: '#^Unsafe call to private method WP_Font_Face_Resolver\:\:to_theme_file_uri\(\) through static\:\:\.$#'188 identifier: staticClassAccess.privateMethod189 count: 1190 path: ../../../src/wp-includes/fonts/class-wp-font-face-resolver.php
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)