Changeset 52610 for trunk/src/wp-includes/theme.php
- Timestamp:
- 01/20/2022 11:51:22 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/theme.php (modified) (36 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/theme.php
r52440 r52610 46 46 47 47 if ( is_array( $wp_theme_directories ) && count( $wp_theme_directories ) > 1 ) { 48 // Make sure the currenttheme wins out, in case search_theme_directories() picks the wrong48 // Make sure the active theme wins out, in case search_theme_directories() picks the wrong 49 49 // one in the case of a conflict. (Normally, last registered theme root wins.) 50 50 $current_theme = get_stylesheet(); … … 106 106 * @global array $wp_theme_directories 107 107 * 108 * @param string $stylesheet Optional. Directory name for the theme. Defaults to currenttheme.108 * @param string $stylesheet Optional. Directory name for the theme. Defaults to active theme. 109 109 * @param string $theme_root Optional. Absolute path of the theme root to look in. 110 110 * If not specified, get_raw_theme_root() is used to calculate 111 * the theme root for the $stylesheet provided (or currenttheme).111 * the theme root for the $stylesheet provided (or active theme). 112 112 * @return WP_Theme Theme object. Be sure to check the object's exists() method 113 113 * if you need to confirm the theme's existence. … … 183 183 184 184 /** 185 * Retrieves stylesheet directory path for currenttheme.185 * Retrieves stylesheet directory path for the active theme. 186 186 * 187 187 * @since 1.5.0 188 188 * 189 * @return string Path to currenttheme's stylesheet directory.189 * @return string Path to active theme's stylesheet directory. 190 190 */ 191 191 function get_stylesheet_directory() { … … 195 195 196 196 /** 197 * Filters the stylesheet directory path for currenttheme.197 * Filters the stylesheet directory path for the active theme. 198 198 * 199 199 * @since 1.5.0 200 200 * 201 * @param string $stylesheet_dir Absolute path to the currenttheme.202 * @param string $stylesheet Directory name of the currenttheme.201 * @param string $stylesheet_dir Absolute path to the active theme. 202 * @param string $stylesheet Directory name of the active theme. 203 203 * @param string $theme_root Absolute path to themes directory. 204 204 */ … … 207 207 208 208 /** 209 * Retrieves stylesheet directory URI for currenttheme.209 * Retrieves stylesheet directory URI for the active theme. 210 210 * 211 211 * @since 1.5.0 212 212 * 213 * @return string URI to currenttheme's stylesheet directory.213 * @return string URI to active theme's stylesheet directory. 214 214 */ 215 215 function get_stylesheet_directory_uri() { … … 231 231 232 232 /** 233 * Retrieves stylesheet URI for currenttheme.233 * Retrieves stylesheet URI for the active theme. 234 234 * 235 235 * The stylesheet file name is 'style.css' which is appended to the stylesheet directory URI path. … … 238 238 * @since 1.5.0 239 239 * 240 * @return string URI to currenttheme's stylesheet.240 * @return string URI to active theme's stylesheet. 241 241 */ 242 242 function get_stylesheet_uri() { … … 244 244 $stylesheet_uri = $stylesheet_dir_uri . '/style.css'; 245 245 /** 246 * Filters the URI of the currenttheme stylesheet.246 * Filters the URI of the active theme stylesheet. 247 247 * 248 248 * @since 1.5.0 249 249 * 250 * @param string $stylesheet_uri Stylesheet URI for the currenttheme/child theme.251 * @param string $stylesheet_dir_uri Stylesheet directory URI for the currenttheme/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. 252 252 */ 253 253 return apply_filters( 'stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri ); … … 273 273 * @global WP_Locale $wp_locale WordPress date and time locale object. 274 274 * 275 * @return string URI to currenttheme's localized stylesheet.275 * @return string URI to active theme's localized stylesheet. 276 276 */ 277 277 function get_locale_stylesheet_uri() { … … 299 299 300 300 /** 301 * Retrieves name of the currenttheme.301 * Retrieves name of the active theme. 302 302 * 303 303 * @since 1.5.0 … … 307 307 function get_template() { 308 308 /** 309 * Filters the name of the currenttheme.309 * Filters the name of the active theme. 310 310 * 311 311 * @since 1.5.0 312 312 * 313 * @param string $template Currenttheme's directory name.313 * @param string $template active theme's directory name. 314 314 */ 315 315 return apply_filters( 'template', get_option( 'template' ) ); … … 317 317 318 318 /** 319 * Retrieves template directory path for currenttheme.319 * Retrieves template directory path for the active theme. 320 320 * 321 321 * @since 1.5.0 322 322 * 323 * @return string Path to currenttheme's template directory.323 * @return string Path to active theme's template directory. 324 324 */ 325 325 function get_template_directory() { … … 329 329 330 330 /** 331 * Filters the currenttheme directory path.331 * Filters the active theme directory path. 332 332 * 333 333 * @since 1.5.0 334 334 * 335 * @param string $template_dir The path of the currenttheme directory.336 * @param string $template Directory name of the currenttheme.335 * @param string $template_dir The path of the active theme directory. 336 * @param string $template Directory name of the active theme. 337 337 * @param string $theme_root Absolute path to the themes directory. 338 338 */ … … 341 341 342 342 /** 343 * Retrieves template directory URI for currenttheme.343 * Retrieves template directory URI for the active theme. 344 344 * 345 345 * @since 1.5.0 346 346 * 347 * @return string URI to currenttheme's template directory.347 * @return string URI to active theme's template directory. 348 348 */ 349 349 function get_template_directory_uri() { … … 353 353 354 354 /** 355 * Filters the currenttheme directory URI.355 * Filters the active theme directory URI. 356 356 * 357 357 * @since 1.5.0 358 358 * 359 * @param string $template_dir_uri The URI of the currenttheme directory.360 * @param string $template Directory name of the currenttheme.359 * @param string $template_dir_uri The URI of the active theme directory. 360 * @param string $template Directory name of the active theme. 361 361 * @param string $theme_root_uri The themes root URI. 362 362 */ … … 500 500 foreach ( $wp_theme_directories as $theme_root ) { 501 501 502 // Start with directories in the root of the currenttheme directory.502 // Start with directories in the root of the active theme directory. 503 503 $dirs = @ scandir( $theme_root ); 504 504 if ( ! $dirs ) { … … 684 684 $theme_root = false; 685 685 686 // If requesting the root for the currenttheme, 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(). 687 687 if ( ! $skip_cache ) { 688 688 if ( get_option( 'stylesheet' ) == $stylesheet_or_template ) { … … 831 831 832 832 /** 833 * Checks that the currenttheme has 'index.php' and 'style.css' files.833 * Checks that the active theme has 'index.php' and 'style.css' files. 834 834 * 835 835 * Does not initially check the default theme, which is the fallback and should always exist. 836 836 * 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 currenttheme does not validate.837 * Will switch theme to the fallback theme if active theme does not validate. 838 838 * 839 839 * You can use the {@see 'validate_current_theme'} filter to return false to disable … … 848 848 function validate_current_theme() { 849 849 /** 850 * Filters whether to validate the currenttheme.850 * Filters whether to validate the active theme. 851 851 * 852 852 * @since 2.7.0 853 853 * 854 * @param bool $validate Whether to validate the currenttheme. Default true.854 * @param bool $validate Whether to validate the active theme. Default true. 855 855 */ 856 856 if ( wp_installing() || ! apply_filters( 'validate_current_theme', true ) ) { … … 982 982 983 983 /** 984 * Retrieves theme modification value for the currenttheme.984 * Retrieves theme modification value for the active theme. 985 985 * 986 986 * If the modification name does not exist and `$default` is a string, then the … … 1008 1008 * @since 2.2.0 1009 1009 * 1010 * @param mixed $current_mod The value of the currenttheme modification.1010 * @param mixed $current_mod The value of the active theme modification. 1011 1011 */ 1012 1012 return apply_filters( "theme_mod_{$name}", $mods[ $name ] ); … … 1027 1027 1028 1028 /** 1029 * Updates theme modification value for the currenttheme.1029 * Updates theme modification value for the active theme. 1030 1030 * 1031 1031 * @since 2.1.0 … … 1060 1060 1061 1061 /** 1062 * Removes theme modification name from currenttheme list.1062 * Removes theme modification name from active theme list. 1063 1063 * 1064 1064 * If removing the name also removes all elements, then the entire option … … 1089 1089 1090 1090 /** 1091 * Removes theme modifications option for currenttheme.1091 * Removes theme modifications option for the active theme. 1092 1092 * 1093 1093 * @since 2.1.0 … … 1396 1396 1397 1397 /** 1398 * Gets the header images uploaded for the currenttheme.1398 * Gets the header images uploaded for the active theme. 1399 1399 * 1400 1400 * @since 3.2.0 … … 1876 1876 * @since 4.7.0 1877 1877 * 1878 * @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the currenttheme.1878 * @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the active theme. 1879 1879 * @return WP_Post|null The custom_css post or null if none exists. 1880 1880 */ … … 1927 1927 * @since 4.7.0 1928 1928 * 1929 * @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the currenttheme.1929 * @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the active theme. 1930 1930 * @return string The Custom CSS Post content. 1931 1931 */ … … 1969 1969 * Normally empty string. 1970 1970 * @type string $stylesheet Optional. Stylesheet (child theme) to update. 1971 * Defaults to currenttheme/stylesheet.1971 * Defaults to active theme/stylesheet. 1972 1972 * } 1973 1973 * @return WP_Post|WP_Error Post on success, error on failure. … … 2128 2128 function get_editor_stylesheets() { 2129 2129 $stylesheets = array(); 2130 // Load editor_style.css if the currenttheme supports it.2130 // Load editor_style.css if the active theme supports it. 2131 2131 if ( ! empty( $GLOBALS['editor_styles'] ) && is_array( $GLOBALS['editor_styles'] ) ) { 2132 2132 $editor_styles = $GLOBALS['editor_styles']; … … 3025 3025 * of possible values. 3026 3026 * @param mixed ...$args Optional extra arguments to be checked against certain features. 3027 * @return bool True if the currenttheme supports the feature, false otherwise.3027 * @return bool True if the active theme supports the feature, false otherwise. 3028 3028 */ 3029 3029 function current_theme_supports( $feature, ...$args ) { … … 3075 3075 3076 3076 /** 3077 * Filters whether the currenttheme supports a specific feature.3077 * Filters whether the active theme supports a specific feature. 3078 3078 * 3079 3079 * The dynamic portion of the hook name, `$feature`, refers to the specific … … 3082 3082 * @since 3.4.0 3083 3083 * 3084 * @param bool $supports Whether the currenttheme supports the given feature. Default true.3084 * @param bool $supports Whether the active theme supports the given feature. Default true. 3085 3085 * @param array $args Array of arguments for the feature. 3086 3086 * @param string $feature The theme feature. … … 3097 3097 * of possible values. 3098 3098 * @param string $include Path to the file. 3099 * @return bool True if the currenttheme supports the supplied feature, false otherwise.3099 * @return bool True if the active theme supports the supplied feature, false otherwise. 3100 3100 */ 3101 3101 function require_if_theme_supports( $feature, $include ) { … … 3110 3110 * Registers a theme feature for use in add_theme_support(). 3111 3111 * 3112 * This does not indicate that the currenttheme supports the feature, it only describes3112 * This does not indicate that the active theme supports the feature, it only describes 3113 3113 * the feature's supported options. 3114 3114 * … … 3623 3623 * @since 3.4.0 3624 3624 * 3625 * @param string $stylesheet Optional. Theme to customize. Defaults to currenttheme.3625 * @param string $stylesheet Optional. Theme to customize. Defaults to active theme. 3626 3626 * The theme's stylesheet will be urlencoded if necessary. 3627 3627 * @return string … … 4156 4156 4157 4157 /** 4158 * Returns whether the currenttheme is a block-based theme or not.4158 * Returns whether the active theme is a block-based theme or not. 4159 4159 * 4160 4160 * @since 5.9.0 4161 4161 * 4162 * @return boolean Whether the currenttheme is a block-based theme or not.4162 * @return boolean Whether the active theme is a block-based theme or not. 4163 4163 */ 4164 4164 function wp_is_block_theme() {
Note: See TracChangeset
for help on using the changeset viewer.