Make WordPress Core

Changeset 51578


Ignore:
Timestamp:
08/07/2021 01:53:58 PM (3 years ago)
Author:
johnbillion
Message:

Themes: Correct the documented types for theme mod values.

A theme mod value can be of any type, not just a string.

See #53399

File:
1 edited

Legend:

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

    r51524 r51578  
    998998 * Retrieves theme modification value for the current theme.
    999999 *
    1000  * If the modification name does not exist, then the $default will be passed
    1001  * through {@link https://www.php.net/sprintf sprintf()} PHP function with
    1002  * the template directory URI as the first string and the stylesheet directory URI
    1003  * as the second string.
     1000 * If the modification name does not exist and `$default` is a string, then the
     1001 * default will be passed through the {@link https://www.php.net/sprintf sprintf()}
     1002 * PHP function with the template directory URI as the first value and the
     1003 * stylesheet directory URI as the second value.
    10041004 *
    10051005 * @since 2.1.0
    10061006 *
    1007  * @param string       $name    Theme modification name.
    1008  * @param string|false $default Optional. Theme modification default value. Default false.
     1007 * @param string $name    Theme modification name.
     1008 * @param mixed $default Optional. Theme modification default value. Default false.
    10091009 * @return mixed Theme modification value.
    10101010 */
     
    10221022         * @since 2.2.0
    10231023         *
    1024          * @param string $current_mod The value of the current theme modification.
     1024         * @param mixed $current_mod The value of the current theme modification.
    10251025         */
    10261026        return apply_filters( "theme_mod_{$name}", $mods[ $name ] );
     
    10631063     * @since 3.9.0
    10641064     *
    1065      * @param string $value     The new value of the theme modification.
    1066      * @param string $old_value The current value of the theme modification.
     1065     * @param mixed $value     The new value of the theme modification.
     1066     * @param mixed $old_value The current value of the theme modification.
    10671067     */
    10681068    $mods[ $name ] = apply_filters( "pre_set_theme_mod_{$name}", $value, $old_value );
Note: See TracChangeset for help on using the changeset viewer.