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

@@ -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' ) );