WordPress.org

Make WordPress Core

Changeset 51284


Ignore:
Timestamp:
06/30/2021 05:19:59 PM (4 months ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks.php

    r51268 r51284  
    220220    $metadata = apply_filters( 'block_type_metadata', $metadata );
    221221
    222     /**
    223      * Add `style` and `editor_style` for core blocks if missing.
    224      */
     222    // Add `style` and `editor_style` for core blocks if missing.
    225223    if ( ! empty( $metadata['name'] ) && 0 === strpos( $metadata['name'], 'core/' ) ) {
    226224        $block_name = str_replace( 'core/', '', $metadata['name'] );
  • trunk/src/wp-includes/class-wp-theme-json-resolver.php

    r51221 r51284  
    113113     *
    114114     * @param array $i18n_partial A tree that follows the format of i18n-theme.json.
    115      * @param array $current_path Keeps track of the path as we walk down the given tree.
     115     * @param array $current_path Optional. Keeps track of the path as we walk down the given tree.
     116     *                            Default empty array.
    116117     * @return array A linear array containing the paths to translate.
    117118     */
     
    266267     * @since 5.8.0
    267268     *
    268      * @param array $theme_support_data Theme support data in theme.json format. Default empty array.
     269     * @param array $theme_support_data Optional. Theme support data in theme.json format.
     270     *                                  Default empty array.
    269271     * @return WP_Theme_JSON Entity that holds theme data.
    270272     */
     
    302304     * @since 5.8.0
    303305     *
    304      * @param array $settings Existing block editor settings.
    305      *                         Empty array by default.
     306     * @param array $settings Optional. Existing block editor settings. Default empty array.
    306307     * @return WP_Theme_JSON
    307308     */
     
    370371
    371372}
    372 
    373 add_action( 'switch_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) );
  • trunk/src/wp-includes/default-filters.php

    r51214 r51284  
    336336add_action( 'init', 'check_theme_switched', 99 );
    337337add_action( 'init', array( 'WP_Block_Supports', 'init' ), 22 );
     338add_action( 'switch_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) );
    338339add_action( 'after_switch_theme', '_wp_menus_changed' );
    339340add_action( 'after_switch_theme', '_wp_sidebars_changed' );
Note: See TracChangeset for help on using the changeset viewer.