Make WordPress Core

Changeset 46394


Ignore:
Timestamp:
10/05/2019 12:39:04 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve documentation for get_theme_mod() and set_theme_mod().

See #47110.

File:
1 edited

Legend:

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

    r46392 r46394  
    906906 *
    907907 * If the modification name does not exist, then the $default will be passed
    908  * through {@link https://secure.php.net/sprintf sprintf()} PHP function with the first
    909  * string the template directory URI and the second string the stylesheet
    910  * directory URI.
     908 * through {@link https://secure.php.net/sprintf sprintf()} PHP function with
     909 * the template directory URI as the first string and the stylesheet directory URI
     910 * as the second string.
    911911 *
    912912 * @since 2.1.0
    913913 *
    914  * @param string      $name    Theme modification name.
    915  * @param bool|string $default
    916  * @return mixed
     914 * @param string       $name    Theme modification name.
     915 * @param string|false $default Optional. Theme modification default value. Default false.
     916 * @return mixed Theme modification value.
    917917 */
    918918function get_theme_mod( $name, $default = false ) {
     
    923923         * Filters the theme modification, or 'theme_mod', value.
    924924         *
    925          * The dynamic portion of the hook name, `$name`, refers to
    926          * the key name of the modification array. For example,
    927          * 'header_textcolor', 'header_image', and so on depending
    928          * on the theme options.
     925         * The dynamic portion of the hook name, `$name`, refers to the key name
     926         * of the modification array. For example, 'header_textcolor', 'header_image',
     927         * and so on depending on the theme options.
    929928         *
    930929         * @since 2.2.0
     
    956955
    957956    /**
    958      * Filters the theme mod value on save.
    959      *
    960      * The dynamic portion of the hook name, `$name`, refers to the key name of
    961      * the modification array. For example, 'header_textcolor', 'header_image',
     957     * Filters the theme modification, or 'theme_mod', value on save.
     958     *
     959     * The dynamic portion of the hook name, `$name`, refers to the key name
     960     * of the modification array. For example, 'header_textcolor', 'header_image',
    962961     * and so on depending on the theme options.
    963962     *
    964963     * @since 3.9.0
    965964     *
    966      * @param string $value     The new value of the theme mod.
    967      * @param string $old_value The current value of the theme mod.
     965     * @param string $value     The new value of the theme modification.
     966     * @param string $old_value The current value of the theme modification.
    968967     */
    969968    $mods[ $name ] = apply_filters( "pre_set_theme_mod_{$name}", $value, $old_value );
Note: See TracChangeset for help on using the changeset viewer.