Docs: Improve documentation for optional parameters in `WP_Theme_JSON_Resolver` methods per the documentation standards.

Move `add_action()` call to `wp-includes/default-filters.php`.

Follow-up to [50959], [51221].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51284


git-svn-id: http://core.svn.wordpress.org/trunk@50893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-06-30 17:20:58 +00:00
parent 40ff2751bc
commit a58c86abd8
4 changed files with 8 additions and 10 deletions

View File

@ -219,9 +219,7 @@ function register_block_type_from_metadata( $file_or_folder, $args = array() ) {
*/
$metadata = apply_filters( 'block_type_metadata', $metadata );
/**
* Add `style` and `editor_style` for core blocks if missing.
*/
// Add `style` and `editor_style` for core blocks if missing.
if ( ! empty( $metadata['name'] ) && 0 === strpos( $metadata['name'], 'core/' ) ) {
$block_name = str_replace( 'core/', '', $metadata['name'] );

View File

@ -112,7 +112,8 @@ class WP_Theme_JSON_Resolver {
* @since 5.8.0
*
* @param array $i18n_partial A tree that follows the format of i18n-theme.json.
* @param array $current_path Keeps track of the path as we walk down the given tree.
* @param array $current_path Optional. Keeps track of the path as we walk down the given tree.
* Default empty array.
* @return array A linear array containing the paths to translate.
*/
private static function extract_paths_to_translate( $i18n_partial, $current_path = array() ) {
@ -265,7 +266,8 @@ class WP_Theme_JSON_Resolver {
*
* @since 5.8.0
*
* @param array $theme_support_data Theme support data in theme.json format. Default empty array.
* @param array $theme_support_data Optional. Theme support data in theme.json format.
* Default empty array.
* @return WP_Theme_JSON Entity that holds theme data.
*/
public static function get_theme_data( $theme_support_data = array() ) {
@ -301,8 +303,7 @@ class WP_Theme_JSON_Resolver {
*
* @since 5.8.0
*
* @param array $settings Existing block editor settings.
* Empty array by default.
* @param array $settings Optional. Existing block editor settings. Default empty array.
* @return WP_Theme_JSON
*/
public static function get_merged_data( $settings = array() ) {
@ -369,5 +370,3 @@ class WP_Theme_JSON_Resolver {
}
}
add_action( 'switch_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) );

View File

@ -335,6 +335,7 @@ add_action( 'init', '_register_core_block_patterns_and_categories' );
add_action( 'current_screen', '_load_remote_block_patterns' );
add_action( 'init', 'check_theme_switched', 99 );
add_action( 'init', array( 'WP_Block_Supports', 'init' ), 22 );
add_action( 'switch_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) );
add_action( 'after_switch_theme', '_wp_menus_changed' );
add_action( 'after_switch_theme', '_wp_sidebars_changed' );
add_action( 'wp_print_styles', 'print_emoji_styles' );

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-51283';
$wp_version = '5.9-alpha-51284';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.