Skip to content

Commit 05923f0

Browse files
committed
Themes: Correct the documented types for theme mod values.
A theme mod value can be of any type, not just a string. See #53399 git-svn-id: https://develop.svn.wordpress.org/trunk@51578 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 14c6bcd commit 05923f0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/wp-includes/theme.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -997,15 +997,15 @@ function get_theme_mods() {
997997
/**
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
*/
10111011
function get_theme_mod( $name, $default = false ) {
@@ -1021,7 +1021,7 @@ function get_theme_mod( $name, $default = false ) {
10211021
*
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 ] );
10271027
}
@@ -1062,8 +1062,8 @@ function set_theme_mod( $name, $value ) {
10621062
*
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 );
10691069

0 commit comments

Comments
 (0)