Make WordPress Core


Ignore:
Timestamp:
03/06/2014 02:03:23 PM (11 years ago)
Author:
DrewAPicture
Message:

Inline documentation for hooks in wp-includes/class-wp-customize-setting.php.

Props kpdesign for the cleanup.
Fixes #27295

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-setting.php

    r27398 r27432  
    123123                break;
    124124            default :
     125
     126                /**
     127                 * Fires when the WP_Customize_Setting::preview() method is called for settings
     128                 * not handled as theme_mods or options.
     129                 *
     130                 * The dynamic portion of the hook name, $this->id, refers to the setting ID.
     131                 *
     132                 * @since 3.4.0
     133                 */
    125134                do_action( 'customize_preview_' . $this->id );
    126135        }
     
    154163            return false;
    155164
     165        /**
     166         * Fires when the WP_Customize_Setting::save() method is called for settings
     167         * not handled as theme_mods or options.
     168         *
     169         * The dynamic portion of the hook name, $this->id_data['base'] refers to
     170         * the base slug of the setting name.
     171         *
     172         * @since 3.4.0
     173         */
    156174        do_action( 'customize_save_' . $this->id_data[ 'base' ] );
    157175
     
    191209    public function sanitize( $value ) {
    192210        $value = wp_unslash( $value );
     211
     212        /**
     213         * Filter a Customize setting value in un-slashed form.
     214         *
     215         * @since 3.4.0
     216         *
     217         * @param mixed                $value Value of the setting.
     218         * @param WP_Customize_Setting $this  WP_Customize_Setting instance.
     219         */
    193220        return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
    194221    }
     
    211238                break;
    212239            default :
     240
     241                /**
     242                 * Fires when the WP_Customize_Setting::update() method is called for settings
     243                 * not handled as theme_mods or options.
     244                 *
     245                 * The dynamic portion of the hook name, $this->type, refers to the type of setting.
     246                 *
     247                 * @since 3.4.0
     248                 *
     249                 * @param mixed $value Value of the setting.
     250                 */
    213251                return do_action( 'customize_update_' . $this->type, $value );
    214252        }
     
    272310                break;
    273311            default :
     312
     313                /**
     314                 * Filter a Customize setting value not handled as a theme_mod or option.
     315                 *
     316                 * The dynamic portion of the hook name, $this->id_date['base'], refers to
     317                 * the base slug of the setting name.
     318                 *
     319                 * For settings handled as theme_mods or options, see those corresponding
     320                 * functions for available hooks.
     321                 *
     322                 * @since 3.4.0
     323                 *
     324                 * @param mixed $default The setting default value. Default empty.
     325                 */
    274326                return apply_filters( 'customize_value_' . $this->id_data[ 'base' ], $this->default );
    275327        }
     
    292344     */
    293345    public function js_value() {
     346
     347        /**
     348         * Filter a Customize setting value for use in JavaScript.
     349         *
     350         * The dynamic portion of the hook name, $this->id, refers to the setting ID.
     351         *
     352         * @since 3.4.0
     353         *
     354         * @param mixed                $value The setting value.
     355         * @param WP_Customize_Setting $this  WP_Customize_Setting instance.
     356         */
    294357        $value = apply_filters( "customize_sanitize_js_{$this->id}", $this->value(), $this );
    295358
Note: See TracChangeset for help on using the changeset viewer.