Make WordPress Core


Ignore:
Timestamp:
01/20/2022 11:51:22 PM (4 years ago)
Author:
audrasjb
Message:

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.

File:
1 edited

Legend:

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

    r52440 r52610  
    4646
    4747    if ( is_array( $wp_theme_directories ) && count( $wp_theme_directories ) > 1 ) {
    48         // Make sure the current theme wins out, in case search_theme_directories() picks the wrong
     48        // Make sure the active theme wins out, in case search_theme_directories() picks the wrong
    4949        // one in the case of a conflict. (Normally, last registered theme root wins.)
    5050        $current_theme = get_stylesheet();
     
    106106 * @global array $wp_theme_directories
    107107 *
    108  * @param string $stylesheet Optional. Directory name for the theme. Defaults to current theme.
     108 * @param string $stylesheet Optional. Directory name for the theme. Defaults to active theme.
    109109 * @param string $theme_root Optional. Absolute path of the theme root to look in.
    110110 *                           If not specified, get_raw_theme_root() is used to calculate
    111  *                           the theme root for the $stylesheet provided (or current theme).
     111 *                           the theme root for the $stylesheet provided (or active theme).
    112112 * @return WP_Theme Theme object. Be sure to check the object's exists() method
    113113 *                  if you need to confirm the theme's existence.
     
    183183
    184184/**
    185  * Retrieves stylesheet directory path for current theme.
     185 * Retrieves stylesheet directory path for the active theme.
    186186 *
    187187 * @since 1.5.0
    188188 *
    189  * @return string Path to current theme's stylesheet directory.
     189 * @return string Path to active theme's stylesheet directory.
    190190 */
    191191function get_stylesheet_directory() {
     
    195195
    196196    /**
    197      * Filters the stylesheet directory path for current theme.
     197     * Filters the stylesheet directory path for the active theme.
    198198     *
    199199     * @since 1.5.0
    200200     *
    201      * @param string $stylesheet_dir Absolute path to the current theme.
    202      * @param string $stylesheet     Directory name of the current theme.
     201     * @param string $stylesheet_dir Absolute path to the active theme.
     202     * @param string $stylesheet     Directory name of the active theme.
    203203     * @param string $theme_root     Absolute path to themes directory.
    204204     */
     
    207207
    208208/**
    209  * Retrieves stylesheet directory URI for current theme.
     209 * Retrieves stylesheet directory URI for the active theme.
    210210 *
    211211 * @since 1.5.0
    212212 *
    213  * @return string URI to current theme's stylesheet directory.
     213 * @return string URI to active theme's stylesheet directory.
    214214 */
    215215function get_stylesheet_directory_uri() {
     
    231231
    232232/**
    233  * Retrieves stylesheet URI for current theme.
     233 * Retrieves stylesheet URI for the active theme.
    234234 *
    235235 * The stylesheet file name is 'style.css' which is appended to the stylesheet directory URI path.
     
    238238 * @since 1.5.0
    239239 *
    240  * @return string URI to current theme's stylesheet.
     240 * @return string URI to active theme's stylesheet.
    241241 */
    242242function get_stylesheet_uri() {
     
    244244    $stylesheet_uri     = $stylesheet_dir_uri . '/style.css';
    245245    /**
    246      * Filters the URI of the current theme stylesheet.
     246     * Filters the URI of the active theme stylesheet.
    247247     *
    248248     * @since 1.5.0
    249249     *
    250      * @param string $stylesheet_uri     Stylesheet URI for the current theme/child theme.
    251      * @param string $stylesheet_dir_uri Stylesheet directory URI for the current theme/child theme.
     250     * @param string $stylesheet_uri     Stylesheet URI for the active theme/child theme.
     251     * @param string $stylesheet_dir_uri Stylesheet directory URI for the active theme/child theme.
    252252     */
    253253    return apply_filters( 'stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri );
     
    273273 * @global WP_Locale $wp_locale WordPress date and time locale object.
    274274 *
    275  * @return string URI to current theme's localized stylesheet.
     275 * @return string URI to active theme's localized stylesheet.
    276276 */
    277277function get_locale_stylesheet_uri() {
     
    299299
    300300/**
    301  * Retrieves name of the current theme.
     301 * Retrieves name of the active theme.
    302302 *
    303303 * @since 1.5.0
     
    307307function get_template() {
    308308    /**
    309      * Filters the name of the current theme.
     309     * Filters the name of the active theme.
    310310     *
    311311     * @since 1.5.0
    312312     *
    313      * @param string $template Current theme's directory name.
     313     * @param string $template active theme's directory name.
    314314     */
    315315    return apply_filters( 'template', get_option( 'template' ) );
     
    317317
    318318/**
    319  * Retrieves template directory path for current theme.
     319 * Retrieves template directory path for the active theme.
    320320 *
    321321 * @since 1.5.0
    322322 *
    323  * @return string Path to current theme's template directory.
     323 * @return string Path to active theme's template directory.
    324324 */
    325325function get_template_directory() {
     
    329329
    330330    /**
    331      * Filters the current theme directory path.
     331     * Filters the active theme directory path.
    332332     *
    333333     * @since 1.5.0
    334334     *
    335      * @param string $template_dir The path of the current theme directory.
    336      * @param string $template     Directory name of the current theme.
     335     * @param string $template_dir The path of the active theme directory.
     336     * @param string $template     Directory name of the active theme.
    337337     * @param string $theme_root   Absolute path to the themes directory.
    338338     */
     
    341341
    342342/**
    343  * Retrieves template directory URI for current theme.
     343 * Retrieves template directory URI for the active theme.
    344344 *
    345345 * @since 1.5.0
    346346 *
    347  * @return string URI to current theme's template directory.
     347 * @return string URI to active theme's template directory.
    348348 */
    349349function get_template_directory_uri() {
     
    353353
    354354    /**
    355      * Filters the current theme directory URI.
     355     * Filters the active theme directory URI.
    356356     *
    357357     * @since 1.5.0
    358358     *
    359      * @param string $template_dir_uri The URI of the current theme directory.
    360      * @param string $template         Directory name of the current theme.
     359     * @param string $template_dir_uri The URI of the active theme directory.
     360     * @param string $template         Directory name of the active theme.
    361361     * @param string $theme_root_uri   The themes root URI.
    362362     */
     
    500500    foreach ( $wp_theme_directories as $theme_root ) {
    501501
    502         // Start with directories in the root of the current theme directory.
     502        // Start with directories in the root of the active theme directory.
    503503        $dirs = @ scandir( $theme_root );
    504504        if ( ! $dirs ) {
     
    684684    $theme_root = false;
    685685
    686     // If requesting the root for the current theme, consult options to avoid calling get_theme_roots().
     686    // If requesting the root for the active theme, consult options to avoid calling get_theme_roots().
    687687    if ( ! $skip_cache ) {
    688688        if ( get_option( 'stylesheet' ) == $stylesheet_or_template ) {
     
    831831
    832832/**
    833  * Checks that the current theme has 'index.php' and 'style.css' files.
     833 * Checks that the active theme has 'index.php' and 'style.css' files.
    834834 *
    835835 * Does not initially check the default theme, which is the fallback and should always exist.
    836836 * But if it doesn't exist, it'll fall back to the latest core default theme that does exist.
    837  * Will switch theme to the fallback theme if current theme does not validate.
     837 * Will switch theme to the fallback theme if active theme does not validate.
    838838 *
    839839 * You can use the {@see 'validate_current_theme'} filter to return false to disable
     
    848848function validate_current_theme() {
    849849    /**
    850      * Filters whether to validate the current theme.
     850     * Filters whether to validate the active theme.
    851851     *
    852852     * @since 2.7.0
    853853     *
    854      * @param bool $validate Whether to validate the current theme. Default true.
     854     * @param bool $validate Whether to validate the active theme. Default true.
    855855     */
    856856    if ( wp_installing() || ! apply_filters( 'validate_current_theme', true ) ) {
     
    982982
    983983/**
    984  * Retrieves theme modification value for the current theme.
     984 * Retrieves theme modification value for the active theme.
    985985 *
    986986 * If the modification name does not exist and `$default` is a string, then the
     
    10081008         * @since 2.2.0
    10091009         *
    1010          * @param mixed $current_mod The value of the current theme modification.
     1010         * @param mixed $current_mod The value of the active theme modification.
    10111011         */
    10121012        return apply_filters( "theme_mod_{$name}", $mods[ $name ] );
     
    10271027
    10281028/**
    1029  * Updates theme modification value for the current theme.
     1029 * Updates theme modification value for the active theme.
    10301030 *
    10311031 * @since 2.1.0
     
    10601060
    10611061/**
    1062  * Removes theme modification name from current theme list.
     1062 * Removes theme modification name from active theme list.
    10631063 *
    10641064 * If removing the name also removes all elements, then the entire option
     
    10891089
    10901090/**
    1091  * Removes theme modifications option for current theme.
     1091 * Removes theme modifications option for the active theme.
    10921092 *
    10931093 * @since 2.1.0
     
    13961396
    13971397/**
    1398  * Gets the header images uploaded for the current theme.
     1398 * Gets the header images uploaded for the active theme.
    13991399 *
    14001400 * @since 3.2.0
     
    18761876 * @since 4.7.0
    18771877 *
    1878  * @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the current theme.
     1878 * @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the active theme.
    18791879 * @return WP_Post|null The custom_css post or null if none exists.
    18801880 */
     
    19271927 * @since 4.7.0
    19281928 *
    1929  * @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the current theme.
     1929 * @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the active theme.
    19301930 * @return string The Custom CSS Post content.
    19311931 */
     
    19691969 *                                Normally empty string.
    19701970 *     @type string $stylesheet   Optional. Stylesheet (child theme) to update.
    1971  *                                Defaults to current theme/stylesheet.
     1971 *                                Defaults to active theme/stylesheet.
    19721972 * }
    19731973 * @return WP_Post|WP_Error Post on success, error on failure.
     
    21282128function get_editor_stylesheets() {
    21292129    $stylesheets = array();
    2130     // Load editor_style.css if the current theme supports it.
     2130    // Load editor_style.css if the active theme supports it.
    21312131    if ( ! empty( $GLOBALS['editor_styles'] ) && is_array( $GLOBALS['editor_styles'] ) ) {
    21322132        $editor_styles = $GLOBALS['editor_styles'];
     
    30253025 *                        of possible values.
    30263026 * @param mixed  ...$args Optional extra arguments to be checked against certain features.
    3027  * @return bool True if the current theme supports the feature, false otherwise.
     3027 * @return bool True if the active theme supports the feature, false otherwise.
    30283028 */
    30293029function current_theme_supports( $feature, ...$args ) {
     
    30753075
    30763076    /**
    3077      * Filters whether the current theme supports a specific feature.
     3077     * Filters whether the active theme supports a specific feature.
    30783078     *
    30793079     * The dynamic portion of the hook name, `$feature`, refers to the specific
     
    30823082     * @since 3.4.0
    30833083     *
    3084      * @param bool   $supports Whether the current theme supports the given feature. Default true.
     3084     * @param bool   $supports Whether the active theme supports the given feature. Default true.
    30853085     * @param array  $args     Array of arguments for the feature.
    30863086     * @param string $feature  The theme feature.
     
    30973097 *                        of possible values.
    30983098 * @param string $include Path to the file.
    3099  * @return bool True if the current theme supports the supplied feature, false otherwise.
     3099 * @return bool True if the active theme supports the supplied feature, false otherwise.
    31003100 */
    31013101function require_if_theme_supports( $feature, $include ) {
     
    31103110 * Registers a theme feature for use in add_theme_support().
    31113111 *
    3112  * This does not indicate that the current theme supports the feature, it only describes
     3112 * This does not indicate that the active theme supports the feature, it only describes
    31133113 * the feature's supported options.
    31143114 *
     
    36233623 * @since 3.4.0
    36243624 *
    3625  * @param string $stylesheet Optional. Theme to customize. Defaults to current theme.
     3625 * @param string $stylesheet Optional. Theme to customize. Defaults to active theme.
    36263626 *                           The theme's stylesheet will be urlencoded if necessary.
    36273627 * @return string
     
    41564156
    41574157/**
    4158  * Returns whether the current theme is a block-based theme or not.
     4158 * Returns whether the active theme is a block-based theme or not.
    41594159 *
    41604160 * @since 5.9.0
    41614161 *
    4162  * @return boolean Whether the current theme is a block-based theme or not.
     4162 * @return boolean Whether the active theme is a block-based theme or not.
    41634163 */
    41644164function wp_is_block_theme() {
Note: See TracChangeset for help on using the changeset viewer.