Make WordPress Core

Changeset 52610


Ignore:
Timestamp:
01/20/2022 11:51:22 PM (5 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.

Location:
trunk/src
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-custom-image-header.php

    r52580 r52610  
    14561456        /**
    14571457         * Given an attachment ID for a header image, unsets it as a user-uploaded
    1458          * header image for the current theme.
     1458         * header image for the active theme.
    14591459         *
    14601460         * Triggered when the user clicks the overlay "X" button next to each image
  • trunk/src/wp-admin/includes/class-theme-installer-skin.php

    r52580 r52610  
    224224                echo '<h2 class="update-from-upload-heading">' . esc_html__( 'This theme is already installed.' ) . '</h2>';
    225225
    226                 // Check errors for current theme.
     226                // Check errors for active theme.
    227227                if ( is_wp_error( $current_theme_data->errors() ) ) {
    228228                        $this->feedback( 'current_theme_has_errors', $current_theme_data->errors()->get_error_message() );
     
    284284                 *
    285285                 * @param string   $table              The output table with Name, Version, Author, RequiresWP, and RequiresPHP info.
    286                  * @param WP_Theme $current_theme_data Current theme data.
     286                 * @param WP_Theme $current_theme_data Active theme data.
    287287                 * @param array    $new_theme_data     Array with uploaded theme data.
    288288                 */
  • trunk/src/wp-admin/includes/class-theme-upgrader.php

    r52580 r52610  
    610610
    611611        /**
    612          * Turn on maintenance mode before attempting to upgrade the current theme.
     612         * Turn on maintenance mode before attempting to upgrade the active theme.
    613613         *
    614614         * Hooked to the {@see 'upgrader_pre_install'} filter by Theme_Upgrader::upgrade() and
     
    628628                $theme = isset( $theme['theme'] ) ? $theme['theme'] : '';
    629629
    630                 // Only run if current theme
     630                // Only run if active theme
    631631                if ( get_stylesheet() !== $theme ) {
    632632                        return $return;
     
    642642
    643643        /**
    644          * Turn off maintenance mode after upgrading the current theme.
     644         * Turn off maintenance mode after upgrading the active theme.
    645645         *
    646646         * Hooked to the {@see 'upgrader_post_install'} filter by Theme_Upgrader::upgrade()
     
    660660                $theme = isset( $theme['theme'] ) ? $theme['theme'] : '';
    661661
    662                 // Only run if current theme.
     662                // Only run if active theme.
    663663                if ( get_stylesheet() !== $theme ) {
    664664                        return $return;
  • trunk/src/wp-admin/includes/dashboard.php

    r52442 r52610  
    19881988 *
    19891989 * @since 3.3.0
    1990  * @since 5.9.0 Send users to the Site Editor if the current theme is block-based.
     1990 * @since 5.9.0 Send users to the Site Editor if the active theme is block-based.
    19911991 */
    19921992function wp_welcome_panel() {
  • trunk/src/wp-admin/includes/file.php

    r52585 r52610  
    288288         *
    289289         * @param string[] $default_types An array of editable theme file extensions.
    290          * @param WP_Theme $theme         The current theme object.
     290         * @param WP_Theme $theme         The active theme object.
    291291         */
    292292        $file_types = apply_filters( 'wp_theme_editor_filetypes', $default_types, $theme );
  • trunk/src/wp-admin/includes/meta-boxes.php

    r52285 r52610  
    486486                                $post_format = '0';
    487487                        }
    488                         // Add in the current one if it isn't there yet, in case the current theme doesn't support it.
     488                        // Add in the current one if it isn't there yet, in case the active theme doesn't support it.
    489489                        if ( $post_format && ! in_array( $post_format, $post_formats[0], true ) ) {
    490490                                $post_formats[0][] = $post_format;
  • trunk/src/wp-admin/includes/theme.php

    r52580 r52610  
    654654         * @param array           $prepared_themes An associative array of theme data. Default empty array.
    655655         * @param WP_Theme[]|null $themes          An array of theme objects to prepare, if any.
    656          * @param string          $current_theme   The current theme slug.
     656         * @param string          $current_theme   The active theme slug.
    657657         */
    658658        $prepared_themes = (array) apply_filters( 'pre_prepare_themes_for_js', array(), $themes, $current_theme );
     
    662662        }
    663663
    664         // Make sure the current theme is listed first.
     664        // Make sure the active theme is listed first.
    665665        $prepared_themes[ $current_theme ] = array();
    666666
  • trunk/src/wp-includes/block-template-utils.php

    r52554 r52610  
    423423
    424424/**
    425  * Parses wp_template content and injects the current theme's
     425 * Parses wp_template content and injects the active theme's
    426426 * stylesheet as a theme attribute into each wp_template_part
    427427 *
  • trunk/src/wp-includes/block-template.php

    r52597 r52610  
    161161        $parent_theme_base_path = get_template_directory() . DIRECTORY_SEPARATOR;
    162162
    163         // Is the current theme a child theme, and is the PHP fallback template part of it?
     163        // Is the active theme a child theme, and is the PHP fallback template part of it?
    164164        if (
    165165                strpos( $fallback_template, $theme_base_path ) === 0 &&
     
    181181                ) {
    182182                        // Unfortunately, we cannot trust $templates[0]->theme, since it will always
    183                         // be set to the current theme's slug by _build_block_template_result_from_file(),
    184                         // even if the block template is really coming from the current theme's parent.
    185                         // (The reason for this is that we want it to be associated with the current theme
     183                        // be set to the active theme's slug by _build_block_template_result_from_file(),
     184                        // even if the block template is really coming from the active theme's parent.
     185                        // (The reason for this is that we want it to be associated with the active theme
    186186                        // -- not its parent -- once we edit it and store it to the DB as a wp_template CPT.)
    187187                        // Instead, we use _get_block_template_file() to locate the block template file.
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r52371 r52610  
    497497         * Start preview and customize theme.
    498498         *
    499          * Check if customize query variable exist. Init filters to filter the current theme.
     499         * Check if customize query variable exist. Init filters to filter the active theme.
    500500         *
    501501         * @since 3.4.0
     
    700700         * Stop previewing the selected theme.
    701701         *
    702          * Removes filters to change the current theme.
     702         * Removes filters to change the active theme.
    703703         *
    704704         * @since 3.4.0
     
    17701770                                if ( isset( $setting_params['type'] ) && 'theme_mod' === $setting_params['type'] ) {
    17711771
    1772                                         // Ensure that theme mods values are only used if they were saved under the current theme.
     1772                                        // Ensure that theme mods values are only used if they were saved under the active theme.
    17731773                                        $namespace_pattern = '/^(?P<stylesheet>.+?)::(?P<setting_id>.+)$/';
    17741774                                        if ( preg_match( $namespace_pattern, $setting_id, $matches ) && $this->get_stylesheet() === $matches['stylesheet'] ) {
     
    22982298
    22992299        /**
    2300          * Filters the current theme and return the name of the previewed theme.
     2300         * Filters the active theme and return the name of the previewed theme.
    23012301         *
    23022302         * @since 3.4.0
  • trunk/src/wp-includes/class-wp-theme-json-resolver.php

    r52597 r52610  
    218218        /**
    219219         * Returns the custom post type that contains the user's origin config
    220          * for the current theme or a void array if none are found.
     220         * for the active theme or a void array if none are found.
    221221         *
    222222         * This can also create and return a new draft custom post type.
     
    225225         *
    226226         * @param WP_Theme $theme              The theme object. If empty, it
    227          *                                     defaults to the current theme.
     227         *                                     defaults to the active theme.
    228228         * @param bool     $create_post        Optional. Whether a new custom post
    229229         *                                     type should be created if none are
     
    397397
    398398        /**
    399          * Whether the current theme has a theme.json file.
     399         * Whether the active theme has a theme.json file.
    400400         *
    401401         * @since 5.8.0
  • trunk/src/wp-includes/class-wp-theme-json.php

    r52597 r52610  
    709709
    710710        /**
    711          * Returns the page templates of the current theme.
     711         * Returns the page templates of the active theme.
    712712         *
    713713         * @since 5.9.0
     
    733733
    734734        /**
    735          * Returns the template part data of current theme.
     735         * Returns the template part data of active theme.
    736736         *
    737737         * @since 5.9.0
  • trunk/src/wp-includes/class-wp-theme.php

    r52603 r52610  
    699699         * @since 3.4.0
    700700         *
    701          * @return WP_Theme|false Parent theme, or false if the current theme is not a child theme.
     701         * @return WP_Theme|false Parent theme, or false if the active theme is not a child theme.
    702702         */
    703703        public function parent() {
     
    12181218         */
    12191219        public function get_post_templates() {
    1220                 // If you screw up your current theme and we invalidate your parent, most things still work. Let it slide.
     1220                // If you screw up your active theme and we invalidate your parent, most things still work. Let it slide.
    12211221                if ( $this->errors() && $this->errors()->get_error_codes() !== array( 'theme_parent_invalid' ) ) {
    12221222                        return array();
  • trunk/src/wp-includes/class.wp-scripts.php

    r51518 r52610  
    126126         * Holds a string which contains the type attribute for script tag.
    127127         *
    128          * If the current theme does not declare HTML5 support for 'script',
     128         * If the active theme does not declare HTML5 support for 'script',
    129129         * then it initializes as `type='text/javascript'`.
    130130         *
  • trunk/src/wp-includes/class.wp-styles.php

    r51518 r52610  
    104104         * Holds a string which contains the type attribute for style tag.
    105105         *
    106          * If the current theme does not declare HTML5 support for 'style',
     106         * If the active theme does not declare HTML5 support for 'style',
    107107         * then it initializes as `type='text/css'`.
    108108         *
  • trunk/src/wp-includes/customize/class-wp-customize-themes-panel.php

    r46586 r52610  
    2828         * An Underscore (JS) template for rendering this panel's container.
    2929         *
    30          * The themes panel renders a custom panel heading with the current theme and a switch themes button.
     30         * The themes panel renders a custom panel heading with the active theme and a switch themes button.
    3131         *
    3232         * @see WP_Customize_Panel::print_template()
  • trunk/src/wp-includes/default-constants.php

    r52093 r52610  
    403403         * Slug of the default theme for this installation.
    404404         * Used as the default theme when installing new sites.
    405          * It will be used as the fallback if the current theme doesn't exist.
     405         * It will be used as the fallback if the active theme doesn't exist.
    406406         *
    407407         * @since 3.0.0
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php

    r52399 r52610  
    335335
    336336                if ( $theme->get_stylesheet() === wp_get_theme()->get_stylesheet() ) {
    337                         // This creates a record for the current theme if not existent.
     337                        // This creates a record for the active theme if not existent.
    338338                        $id = WP_Theme_JSON_Resolver::get_user_global_styles_post_id();
    339339                } else {
  • 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() {
  • trunk/src/wp-includes/update.php

    r52351 r52610  
    569569        $request = array();
    570570
    571         // Put slug of current theme into request.
     571        // Put slug of active theme into request.
    572572        $request['active'] = get_option( 'stylesheet' );
    573573
  • trunk/src/wp-includes/widgets/class-wp-widget-search.php

    r50995 r52610  
    5252                }
    5353
    54                 // Use current theme search form if it exists.
     54                // Use active theme search form if it exists.
    5555                get_search_form();
    5656
Note: See TracChangeset for help on using the changeset viewer.