Docs: Replace "Current theme" with "Active theme" in various DocBlocks.

This change replaces "Current theme" with "Active theme" in various DocBlocks for better consistency with user-facing strings.

Follow-up to [52580].

Props Presskopp, audrasjb, costdev.
Fixes #54831.
See #54770.


git-svn-id: https://develop.svn.wordpress.org/trunk@52610 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jb Audras
2022-01-20 23:51:22 +00:00
parent 7ca1a2a0d7
commit 8db1549c0f
21 changed files with 88 additions and 88 deletions
+53 -53
View File
@@ -45,7 +45,7 @@ function wp_get_themes( $args = array() ) {
$theme_directories = search_theme_directories();
if ( is_array( $wp_theme_directories ) && count( $wp_theme_directories ) > 1 ) {
// Make sure the current theme wins out, in case search_theme_directories() picks the wrong
// Make sure the active theme wins out, in case search_theme_directories() picks the wrong
// one in the case of a conflict. (Normally, last registered theme root wins.)
$current_theme = get_stylesheet();
if ( isset( $theme_directories[ $current_theme ] ) ) {
@@ -105,10 +105,10 @@ function wp_get_themes( $args = array() ) {
*
* @global array $wp_theme_directories
*
* @param string $stylesheet Optional. Directory name for the theme. Defaults to current theme.
* @param string $stylesheet Optional. Directory name for the theme. Defaults to active theme.
* @param string $theme_root Optional. Absolute path of the theme root to look in.
* If not specified, get_raw_theme_root() is used to calculate
* the theme root for the $stylesheet provided (or current theme).
* the theme root for the $stylesheet provided (or active theme).
* @return WP_Theme Theme object. Be sure to check the object's exists() method
* if you need to confirm the theme's existence.
*/
@@ -182,11 +182,11 @@ function get_stylesheet() {
}
/**
* Retrieves stylesheet directory path for current theme.
* Retrieves stylesheet directory path for the active theme.
*
* @since 1.5.0
*
* @return string Path to current theme's stylesheet directory.
* @return string Path to active theme's stylesheet directory.
*/
function get_stylesheet_directory() {
$stylesheet = get_stylesheet();
@@ -194,23 +194,23 @@ function get_stylesheet_directory() {
$stylesheet_dir = "$theme_root/$stylesheet";
/**
* Filters the stylesheet directory path for current theme.
* Filters the stylesheet directory path for the active theme.
*
* @since 1.5.0
*
* @param string $stylesheet_dir Absolute path to the current theme.
* @param string $stylesheet Directory name of the current theme.
* @param string $stylesheet_dir Absolute path to the active theme.
* @param string $stylesheet Directory name of the active theme.
* @param string $theme_root Absolute path to themes directory.
*/
return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root );
}
/**
* Retrieves stylesheet directory URI for current theme.
* Retrieves stylesheet directory URI for the active theme.
*
* @since 1.5.0
*
* @return string URI to current theme's stylesheet directory.
* @return string URI to active theme's stylesheet directory.
*/
function get_stylesheet_directory_uri() {
$stylesheet = str_replace( '%2F', '/', rawurlencode( get_stylesheet() ) );
@@ -230,25 +230,25 @@ function get_stylesheet_directory_uri() {
}
/**
* Retrieves stylesheet URI for current theme.
* Retrieves stylesheet URI for the active theme.
*
* The stylesheet file name is 'style.css' which is appended to the stylesheet directory URI path.
* See get_stylesheet_directory_uri().
*
* @since 1.5.0
*
* @return string URI to current theme's stylesheet.
* @return string URI to active theme's stylesheet.
*/
function get_stylesheet_uri() {
$stylesheet_dir_uri = get_stylesheet_directory_uri();
$stylesheet_uri = $stylesheet_dir_uri . '/style.css';
/**
* Filters the URI of the current theme stylesheet.
* Filters the URI of the active theme stylesheet.
*
* @since 1.5.0
*
* @param string $stylesheet_uri Stylesheet URI for the current theme/child theme.
* @param string $stylesheet_dir_uri Stylesheet directory URI for the current theme/child theme.
* @param string $stylesheet_uri Stylesheet URI for the active theme/child theme.
* @param string $stylesheet_dir_uri Stylesheet directory URI for the active theme/child theme.
*/
return apply_filters( 'stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri );
}
@@ -272,7 +272,7 @@ function get_stylesheet_uri() {
*
* @global WP_Locale $wp_locale WordPress date and time locale object.
*
* @return string URI to current theme's localized stylesheet.
* @return string URI to active theme's localized stylesheet.
*/
function get_locale_stylesheet_uri() {
global $wp_locale;
@@ -298,7 +298,7 @@ function get_locale_stylesheet_uri() {
}
/**
* Retrieves name of the current theme.
* Retrieves name of the active theme.
*
* @since 1.5.0
*
@@ -306,21 +306,21 @@ function get_locale_stylesheet_uri() {
*/
function get_template() {
/**
* Filters the name of the current theme.
* Filters the name of the active theme.
*
* @since 1.5.0
*
* @param string $template Current theme's directory name.
* @param string $template active theme's directory name.
*/
return apply_filters( 'template', get_option( 'template' ) );
}
/**
* Retrieves template directory path for current theme.
* Retrieves template directory path for the active theme.
*
* @since 1.5.0
*
* @return string Path to current theme's template directory.
* @return string Path to active theme's template directory.
*/
function get_template_directory() {
$template = get_template();
@@ -328,23 +328,23 @@ function get_template_directory() {
$template_dir = "$theme_root/$template";
/**
* Filters the current theme directory path.
* Filters the active theme directory path.
*
* @since 1.5.0
*
* @param string $template_dir The path of the current theme directory.
* @param string $template Directory name of the current theme.
* @param string $template_dir The path of the active theme directory.
* @param string $template Directory name of the active theme.
* @param string $theme_root Absolute path to the themes directory.
*/
return apply_filters( 'template_directory', $template_dir, $template, $theme_root );
}
/**
* Retrieves template directory URI for current theme.
* Retrieves template directory URI for the active theme.
*
* @since 1.5.0
*
* @return string URI to current theme's template directory.
* @return string URI to active theme's template directory.
*/
function get_template_directory_uri() {
$template = str_replace( '%2F', '/', rawurlencode( get_template() ) );
@@ -352,12 +352,12 @@ function get_template_directory_uri() {
$template_dir_uri = "$theme_root_uri/$template";
/**
* Filters the current theme directory URI.
* Filters the active theme directory URI.
*
* @since 1.5.0
*
* @param string $template_dir_uri The URI of the current theme directory.
* @param string $template Directory name of the current theme.
* @param string $template_dir_uri The URI of the active theme directory.
* @param string $template Directory name of the active theme.
* @param string $theme_root_uri The themes root URI.
*/
return apply_filters( 'template_directory_uri', $template_dir_uri, $template, $theme_root_uri );
@@ -499,7 +499,7 @@ function search_theme_directories( $force = false ) {
/* Loop the registered theme directories and extract all themes */
foreach ( $wp_theme_directories as $theme_root ) {
// Start with directories in the root of the current theme directory.
// Start with directories in the root of the active theme directory.
$dirs = @ scandir( $theme_root );
if ( ! $dirs ) {
trigger_error( "$theme_root is not readable", E_USER_NOTICE );
@@ -683,7 +683,7 @@ function get_raw_theme_root( $stylesheet_or_template, $skip_cache = false ) {
$theme_root = false;
// If requesting the root for the current theme, consult options to avoid calling get_theme_roots().
// If requesting the root for the active theme, consult options to avoid calling get_theme_roots().
if ( ! $skip_cache ) {
if ( get_option( 'stylesheet' ) == $stylesheet_or_template ) {
$theme_root = get_option( 'stylesheet_root' );
@@ -830,11 +830,11 @@ function switch_theme( $stylesheet ) {
}
/**
* Checks that the current theme has 'index.php' and 'style.css' files.
* Checks that the active theme has 'index.php' and 'style.css' files.
*
* Does not initially check the default theme, which is the fallback and should always exist.
* But if it doesn't exist, it'll fall back to the latest core default theme that does exist.
* Will switch theme to the fallback theme if current theme does not validate.
* Will switch theme to the fallback theme if active theme does not validate.
*
* You can use the {@see 'validate_current_theme'} filter to return false to disable
* this functionality.
@@ -847,11 +847,11 @@ function switch_theme( $stylesheet ) {
*/
function validate_current_theme() {
/**
* Filters whether to validate the current theme.
* Filters whether to validate the active theme.
*
* @since 2.7.0
*
* @param bool $validate Whether to validate the current theme. Default true.
* @param bool $validate Whether to validate the active theme. Default true.
*/
if ( wp_installing() || ! apply_filters( 'validate_current_theme', true ) ) {
return true;
@@ -981,7 +981,7 @@ function get_theme_mods() {
}
/**
* Retrieves theme modification value for the current theme.
* Retrieves theme modification value for the active theme.
*
* If the modification name does not exist and `$default` is a string, then the
* default will be passed through the {@link https://www.php.net/sprintf sprintf()}
@@ -1007,7 +1007,7 @@ function get_theme_mod( $name, $default = false ) {
*
* @since 2.2.0
*
* @param mixed $current_mod The value of the current theme modification.
* @param mixed $current_mod The value of the active theme modification.
*/
return apply_filters( "theme_mod_{$name}", $mods[ $name ] );
}
@@ -1026,7 +1026,7 @@ function get_theme_mod( $name, $default = false ) {
}
/**
* Updates theme modification value for the current theme.
* Updates theme modification value for the active theme.
*
* @since 2.1.0
* @since 5.6.0 A return value was added.
@@ -1059,7 +1059,7 @@ function set_theme_mod( $name, $value ) {
}
/**
* Removes theme modification name from current theme list.
* Removes theme modification name from active theme list.
*
* If removing the name also removes all elements, then the entire option
* will be removed.
@@ -1088,7 +1088,7 @@ function remove_theme_mod( $name ) {
}
/**
* Removes theme modifications option for current theme.
* Removes theme modifications option for the active theme.
*
* @since 2.1.0
*/
@@ -1395,7 +1395,7 @@ function header_image() {
}
/**
* Gets the header images uploaded for the current theme.
* Gets the header images uploaded for the active theme.
*
* @since 3.2.0
*
@@ -1875,7 +1875,7 @@ function wp_custom_css_cb() {
*
* @since 4.7.0
*
* @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the current theme.
* @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the active theme.
* @return WP_Post|null The custom_css post or null if none exists.
*/
function wp_get_custom_css_post( $stylesheet = '' ) {
@@ -1926,7 +1926,7 @@ function wp_get_custom_css_post( $stylesheet = '' ) {
*
* @since 4.7.0
*
* @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the current theme.
* @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the active theme.
* @return string The Custom CSS Post content.
*/
function wp_get_custom_css( $stylesheet = '' ) {
@@ -1968,7 +1968,7 @@ function wp_get_custom_css( $stylesheet = '' ) {
* @type string $preprocessed Optional. Pre-processed CSS, stored in `post_content_filtered`.
* Normally empty string.
* @type string $stylesheet Optional. Stylesheet (child theme) to update.
* Defaults to current theme/stylesheet.
* Defaults to active theme/stylesheet.
* }
* @return WP_Post|WP_Error Post on success, error on failure.
*/
@@ -2127,7 +2127,7 @@ function remove_editor_styles() {
*/
function get_editor_stylesheets() {
$stylesheets = array();
// Load editor_style.css if the current theme supports it.
// Load editor_style.css if the active theme supports it.
if ( ! empty( $GLOBALS['editor_styles'] ) && is_array( $GLOBALS['editor_styles'] ) ) {
$editor_styles = $GLOBALS['editor_styles'];
@@ -3024,7 +3024,7 @@ function _remove_theme_support( $feature ) {
* @param string $feature The feature being checked. See add_theme_support() for the list
* of possible values.
* @param mixed ...$args Optional extra arguments to be checked against certain features.
* @return bool True if the current theme supports the feature, false otherwise.
* @return bool True if the active theme supports the feature, false otherwise.
*/
function current_theme_supports( $feature, ...$args ) {
global $_wp_theme_features;
@@ -3074,14 +3074,14 @@ function current_theme_supports( $feature, ...$args ) {
}
/**
* Filters whether the current theme supports a specific feature.
* Filters whether the active theme supports a specific feature.
*
* The dynamic portion of the hook name, `$feature`, refers to the specific
* theme feature. See add_theme_support() for the list of possible values.
*
* @since 3.4.0
*
* @param bool $supports Whether the current theme supports the given feature. Default true.
* @param bool $supports Whether the active theme supports the given feature. Default true.
* @param array $args Array of arguments for the feature.
* @param string $feature The theme feature.
*/
@@ -3096,7 +3096,7 @@ function current_theme_supports( $feature, ...$args ) {
* @param string $feature The feature being checked. See add_theme_support() for the list
* of possible values.
* @param string $include Path to the file.
* @return bool True if the current theme supports the supplied feature, false otherwise.
* @return bool True if the active theme supports the supplied feature, false otherwise.
*/
function require_if_theme_supports( $feature, $include ) {
if ( current_theme_supports( $feature ) ) {
@@ -3109,7 +3109,7 @@ function require_if_theme_supports( $feature, $include ) {
/**
* Registers a theme feature for use in add_theme_support().
*
* This does not indicate that the current theme supports the feature, it only describes
* This does not indicate that the active theme supports the feature, it only describes
* the feature's supported options.
*
* @since 5.5.0
@@ -3622,7 +3622,7 @@ function _wp_customize_loader_settings() {
*
* @since 3.4.0
*
* @param string $stylesheet Optional. Theme to customize. Defaults to current theme.
* @param string $stylesheet Optional. Theme to customize. Defaults to active theme.
* The theme's stylesheet will be urlencoded if necessary.
* @return string
*/
@@ -4155,11 +4155,11 @@ function create_initial_theme_features() {
}
/**
* Returns whether the current theme is a block-based theme or not.
* Returns whether the active theme is a block-based theme or not.
*
* @since 5.9.0
*
* @return boolean Whether the current theme is a block-based theme or not.
* @return boolean Whether the active theme is a block-based theme or not.
*/
function wp_is_block_theme() {
return wp_get_theme()->is_block_theme();