Docs: Improve documentation for `get_theme_mod()` and `set_theme_mod()`.
See #47110. Built from https://develop.svn.wordpress.org/trunk@46394 git-svn-id: http://core.svn.wordpress.org/trunk@46193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
538e0d4fb3
commit
5fd25a6944
|
@ -905,15 +905,15 @@ function get_theme_mods() {
|
||||||
* Retrieve theme modification value for the current theme.
|
* Retrieve theme modification value for the current theme.
|
||||||
*
|
*
|
||||||
* If the modification name does not exist, then the $default will be passed
|
* If the modification name does not exist, then the $default will be passed
|
||||||
* through {@link https://secure.php.net/sprintf sprintf()} PHP function with the first
|
* through {@link https://secure.php.net/sprintf sprintf()} PHP function with
|
||||||
* string the template directory URI and the second string the stylesheet
|
* the template directory URI as the first string and the stylesheet directory URI
|
||||||
* directory URI.
|
* as the second string.
|
||||||
*
|
*
|
||||||
* @since 2.1.0
|
* @since 2.1.0
|
||||||
*
|
*
|
||||||
* @param string $name Theme modification name.
|
* @param string $name Theme modification name.
|
||||||
* @param bool|string $default
|
* @param string|false $default Optional. Theme modification default value. Default false.
|
||||||
* @return mixed
|
* @return mixed Theme modification value.
|
||||||
*/
|
*/
|
||||||
function get_theme_mod( $name, $default = false ) {
|
function get_theme_mod( $name, $default = false ) {
|
||||||
$mods = get_theme_mods();
|
$mods = get_theme_mods();
|
||||||
|
@ -922,10 +922,9 @@ function get_theme_mod( $name, $default = false ) {
|
||||||
/**
|
/**
|
||||||
* Filters the theme modification, or 'theme_mod', value.
|
* Filters the theme modification, or 'theme_mod', value.
|
||||||
*
|
*
|
||||||
* The dynamic portion of the hook name, `$name`, refers to
|
* The dynamic portion of the hook name, `$name`, refers to the key name
|
||||||
* the key name of the modification array. For example,
|
* of the modification array. For example, 'header_textcolor', 'header_image',
|
||||||
* 'header_textcolor', 'header_image', and so on depending
|
* and so on depending on the theme options.
|
||||||
* on the theme options.
|
|
||||||
*
|
*
|
||||||
* @since 2.2.0
|
* @since 2.2.0
|
||||||
*
|
*
|
||||||
|
@ -955,16 +954,16 @@ function set_theme_mod( $name, $value ) {
|
||||||
$old_value = isset( $mods[ $name ] ) ? $mods[ $name ] : false;
|
$old_value = isset( $mods[ $name ] ) ? $mods[ $name ] : false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters the theme mod value on save.
|
* Filters the theme modification, or 'theme_mod', value on save.
|
||||||
*
|
*
|
||||||
* The dynamic portion of the hook name, `$name`, refers to the key name of
|
* The dynamic portion of the hook name, `$name`, refers to the key name
|
||||||
* the modification array. For example, 'header_textcolor', 'header_image',
|
* of the modification array. For example, 'header_textcolor', 'header_image',
|
||||||
* and so on depending on the theme options.
|
* and so on depending on the theme options.
|
||||||
*
|
*
|
||||||
* @since 3.9.0
|
* @since 3.9.0
|
||||||
*
|
*
|
||||||
* @param string $value The new value of the theme mod.
|
* @param string $value The new value of the theme modification.
|
||||||
* @param string $old_value The current value of the theme mod.
|
* @param string $old_value The current value of the theme modification.
|
||||||
*/
|
*/
|
||||||
$mods[ $name ] = apply_filters( "pre_set_theme_mod_{$name}", $value, $old_value );
|
$mods[ $name ] = apply_filters( "pre_set_theme_mod_{$name}", $value, $old_value );
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.3-beta2-46393';
|
$wp_version = '5.3-beta2-46394';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue