mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@51284 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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'] );
|
||||
|
||||
|
||||
@@ -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' ) );
|
||||
|
||||
@@ -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' );
|
||||
|
||||
Reference in New Issue
Block a user