Make WordPress Core

Changeset 46392


Ignore:
Timestamp:
10/04/2019 11:20:01 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Themes: Bring default values for get_theme_root(), get_theme_root_uri(), wp_get_theme(), and wp_customize_url() in line with the documentation.

Reverts [46327].

Fixes #44397.

File:
1 edited

Legend:

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

    r46327 r46392  
    108108 * @return WP_Theme Theme object. Be sure to check the object's exists() method if you need to confirm the theme's existence.
    109109 */
    110 function wp_get_theme( $stylesheet = null, $theme_root = null ) {
     110function wp_get_theme( $stylesheet = '', $theme_root = '' ) {
    111111    global $wp_theme_directories;
    112112
     
    567567 * @global array $wp_theme_directories
    568568 *
    569  * @param string $stylesheet_or_template The stylesheet or template name of the theme
    570  * @return string Theme path.
    571  */
    572 function get_theme_root( $stylesheet_or_template = false ) {
     569 * @param string $stylesheet_or_template Optional. The stylesheet or template name of the theme.
     570 *                                       Default is to leverage the main theme root.
     571 * @return string Themes directory path.
     572 */
     573function get_theme_root( $stylesheet_or_template = '' ) {
    573574    global $wp_theme_directories;
    574575
     
    609610 * @global array $wp_theme_directories
    610611 *
    611  * @param bool|string $stylesheet_or_template Optional. The stylesheet or template name of the theme.
    612  *                                            Default value false, to use the main theme root.
    613  * @param bool|string $theme_root             Optional. The theme root for which calculations will be based, preventing
    614  *                                            the need for a get_raw_theme_root() call. Default value false.
    615  * @return string Themes URI.
    616  */
    617 function get_theme_root_uri( $stylesheet_or_template = false, $theme_root = false ) {
     612 * @param string $stylesheet_or_template Optional. The stylesheet or template name of the theme.
     613 *                                       Default is to leverage the main theme root.
     614 * @param string $theme_root             Optional. The theme root for which calculations will be based,
     615 *                                       preventing the need for a get_raw_theme_root() call. Default empty.
     616 * @return string Themes directory URI.
     617 */
     618function get_theme_root_uri( $stylesheet_or_template = '', $theme_root = '' ) {
    618619    global $wp_theme_directories;
    619620
     
    648649     * @param string $theme_root_uri         The URI for themes directory.
    649650     * @param string $siteurl                WordPress web address which is set in General Options.
    650      * @param string $stylesheet_or_template Stylesheet or template name of the theme.
     651     * @param string $stylesheet_or_template The stylesheet or template name of the theme.
    651652     */
    652653    return apply_filters( 'theme_root_uri', $theme_root_uri, get_option( 'siteurl' ), $stylesheet_or_template );
     
    660661 * @global array $wp_theme_directories
    661662 *
    662  * @param string $stylesheet_or_template The stylesheet or template name of the theme
     663 * @param string $stylesheet_or_template The stylesheet or template name of the theme.
    663664 * @param bool   $skip_cache             Optional. Whether to skip the cache.
    664665 *                                       Defaults to false, meaning the cache is used.
    665  * @return string Theme root
     666 * @return string Theme root.
    666667 */
    667668function get_raw_theme_root( $stylesheet_or_template, $skip_cache = false ) {
     
    31813182 * @return string
    31823183 */
    3183 function wp_customize_url( $stylesheet = null ) {
     3184function wp_customize_url( $stylesheet = '' ) {
    31843185    $url = admin_url( 'customize.php' );
    31853186    if ( $stylesheet ) {
Note: See TracChangeset for help on using the changeset viewer.