mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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
This commit is contained in:
parent
04e3fd6995
commit
fb0e6531ab
@ -256,6 +256,28 @@ function get_theme_update_available( $theme ) {
|
|||||||
* Retrieve list of WordPress theme features (aka theme tags).
|
* Retrieve list of WordPress theme features (aka theme tags).
|
||||||
*
|
*
|
||||||
* @since 3.1.0
|
* @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.
|
* @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.
|
* @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' ),
|
'Subject' => __( 'Subject' ),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Loop over the wp.org canonical list and apply translations.
|
|
||||||
$wporg_features = array();
|
$wporg_features = array();
|
||||||
|
|
||||||
|
// Loop over the wp.org canonical list and apply translations.
|
||||||
foreach ( (array) $feature_list as $feature_category => $feature_items ) {
|
foreach ( (array) $feature_list as $feature_category => $feature_items ) {
|
||||||
if ( isset( $category_translations[ $feature_category ] ) ) {
|
if ( isset( $category_translations[ $feature_category ] ) ) {
|
||||||
$feature_category = $category_translations[ $feature_category ];
|
$feature_category = $category_translations[ $feature_category ];
|
||||||
}
|
}
|
||||||
|
|
||||||
$wporg_features[ $feature_category ] = array();
|
$wporg_features[ $feature_category ] = array();
|
||||||
|
|
||||||
foreach ( $feature_items as $feature ) {
|
foreach ( $feature_items as $feature ) {
|
||||||
|
@ -208,7 +208,10 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
|||||||
<button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
|
<button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
$feature_list = get_theme_feature_list( false ); // Use the core list, rather than the .org API, due to inconsistencies and to ensure tags are translated.
|
// Use the core list, rather than the .org API, due to inconsistencies
|
||||||
|
// and to ensure tags are translated.
|
||||||
|
$feature_list = get_theme_feature_list( false );
|
||||||
|
|
||||||
foreach ( $feature_list as $feature_name => $features ) {
|
foreach ( $feature_list as $feature_name => $features ) {
|
||||||
echo '<fieldset class="filter-group">';
|
echo '<fieldset class="filter-group">';
|
||||||
$feature_name = esc_html( $feature_name );
|
$feature_name = esc_html( $feature_name );
|
||||||
|
@ -934,8 +934,10 @@ final class WP_Theme implements ArrayAccess {
|
|||||||
if ( isset( $this->name_translated ) ) {
|
if ( isset( $this->name_translated ) ) {
|
||||||
return $this->name_translated;
|
return $this->name_translated;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain
|
// phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText,WordPress.WP.I18n.NonSingularStringLiteralDomain
|
||||||
$this->name_translated = translate( $value, $this->get( 'TextDomain' ) );
|
$this->name_translated = translate( $value, $this->get( 'TextDomain' ) );
|
||||||
|
|
||||||
return $this->name_translated;
|
return $this->name_translated;
|
||||||
case 'Tags':
|
case 'Tags':
|
||||||
if ( empty( $value ) || ! function_exists( 'get_theme_feature_list' ) ) {
|
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.
|
$feature_list = get_theme_feature_list( false ); // No API.
|
||||||
|
|
||||||
foreach ( $feature_list as $tags ) {
|
foreach ( $feature_list as $tags ) {
|
||||||
$tags_list += $tags;
|
$tags_list += $tags;
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,9 @@ class WP_Customize_Themes_Section extends WP_Customize_Section {
|
|||||||
* @since 4.9.0
|
* @since 4.9.0
|
||||||
*/
|
*/
|
||||||
protected function filter_drawer_content_template() {
|
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 ) { #>
|
<# if ( 'wporg' === data.action ) { #>
|
||||||
<div class="filter-drawer filter-details">
|
<div class="filter-drawer filter-details">
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user