From fb0e6531ab00961d33bd70c45ad1643c1a46fd4e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 14 May 2020 12:50:08 +0000 Subject: [PATCH] Docs: Add `@since` notes for theme features added or removed in `get_theme_feature_list()` after its introduction in WordPress 3.1. See #50165. Built from https://develop.svn.wordpress.org/trunk@47794 git-svn-id: http://core.svn.wordpress.org/trunk@47570 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/theme.php | 26 ++++++++++++++++++- wp-admin/theme-install.php | 5 +++- wp-includes/class-wp-theme.php | 3 +++ .../class-wp-customize-themes-section.php | 4 ++- wp-includes/version.php | 2 +- 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index ed3139154c..c89dbb3044 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -256,6 +256,28 @@ function get_theme_update_available( $theme ) { * Retrieve list of WordPress theme features (aka theme tags). * * @since 3.1.0 + * @since 3.2.0 Added 'Gray' color and 'Featured Image Header', 'Featured Images', + * 'Full Width Template', and 'Post Formats' features. + * @since 3.5.0 Added 'Flexible Header' feature. + * @since 3.8.0 Renamed 'Width' filter to 'Layout'. + * @since 3.8.0 Renamed 'Fixed Width' and 'Flexible Width' options + * to 'Fixed Layout' and 'Fluid Layout'. + * @since 3.8.0 Added 'Accessibility Ready' feature and 'Responsive Layout' option. + * @since 3.9.0 Combined 'Layout' and 'Columns' filters. + * @since 4.6.0 Removed 'Colors' filter. + * @since 4.6.0 Added 'Grid Layout' option. + * Removed 'Fixed Layout', 'Fluid Layout', and 'Responsive Layout' options. + * @since 4.6.0 Added 'Custom Logo' and 'Footer Widgets' features. + * Removed 'Blavatar' feature. + * @since 4.6.0 Added 'Blog', 'E-Commerce', 'Education', 'Entertainment', 'Food & Drink', + * 'Holiday', 'News', 'Photography', and 'Portfolio' subjects. + * Removed 'Photoblogging' and 'Seasonal' subjects. + * @since 4.9.0 Reordered the filters from 'Layout', 'Features', 'Subject' + * to 'Subject', 'Features', 'Layout'. + * @since 4.9.0 Removed 'BuddyPress', 'Custom Menu', 'Flexible Header', + * 'Front Page Posting', 'Microformats', 'RTL Language Support', + * 'Threaded Comments', and 'Translation Ready' features. + * @since 5.5.0 Added 'Block Editor Styles' and 'Wide Blocks' features. * * @param bool $api Optional. Whether try to fetch tags from the WordPress.org API. Defaults to true. * @return array Array of features keyed by category with translations keyed by slug. @@ -334,12 +356,14 @@ function get_theme_feature_list( $api = true ) { 'Subject' => __( 'Subject' ), ); - // Loop over the wp.org canonical list and apply translations. $wporg_features = array(); + + // Loop over the wp.org canonical list and apply translations. foreach ( (array) $feature_list as $feature_category => $feature_items ) { if ( isset( $category_translations[ $feature_category ] ) ) { $feature_category = $category_translations[ $feature_category ]; } + $wporg_features[ $feature_category ] = array(); foreach ( $feature_items as $feature ) { diff --git a/wp-admin/theme-install.php b/wp-admin/theme-install.php index 944e9d7d0a..2519ed01ae 100644 --- a/wp-admin/theme-install.php +++ b/wp-admin/theme-install.php @@ -208,7 +208,10 @@ require_once ABSPATH . 'wp-admin/admin-header.php'; $features ) { echo '
'; $feature_name = esc_html( $feature_name ); diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index 124ee11524..c38262e623 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -934,8 +934,10 @@ final class WP_Theme implements ArrayAccess { if ( isset( $this->name_translated ) ) { return $this->name_translated; } + // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain $this->name_translated = translate( $value, $this->get( 'TextDomain' ) ); + return $this->name_translated; case 'Tags': if ( empty( $value ) || ! function_exists( 'get_theme_feature_list' ) ) { @@ -970,6 +972,7 @@ final class WP_Theme implements ArrayAccess { ); $feature_list = get_theme_feature_list( false ); // No API. + foreach ( $feature_list as $tags ) { $tags_list += $tags; } diff --git a/wp-includes/customize/class-wp-customize-themes-section.php b/wp-includes/customize/class-wp-customize-themes-section.php index 2544fc2b5f..260380191e 100644 --- a/wp-includes/customize/class-wp-customize-themes-section.php +++ b/wp-includes/customize/class-wp-customize-themes-section.php @@ -164,7 +164,9 @@ class WP_Customize_Themes_Section extends WP_Customize_Section { * @since 4.9.0 */ protected function filter_drawer_content_template() { - $feature_list = get_theme_feature_list( false ); // @todo Use the .org API instead of the local core feature list. The .org API is currently outdated and will be reconciled when the .org themes directory is next redesigned. + // @todo Use the .org API instead of the local core feature list. + // The .org API is currently outdated and will be reconciled when the .org themes directory is next redesigned. + $feature_list = get_theme_feature_list( false ); ?> <# if ( 'wporg' === data.action ) { #>
diff --git a/wp-includes/version.php b/wp-includes/version.php index 0f12f3e2c9..346792ed62 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47790'; +$wp_version = '5.5-alpha-47794'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.