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

Props kpdesign for the cleanup.
Fixes #27295

Built from https://develop.svn.wordpress.org/trunk@27432


git-svn-id: http://core.svn.wordpress.org/trunk@27279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2014-03-06 14:04:13 +00:00
parent 277d715d9e
commit 5ac55b9b1a
1 changed files with 63 additions and 0 deletions

View File

@ -122,6 +122,15 @@ class WP_Customize_Setting {
}
break;
default :
/**
* Fires when the WP_Customize_Setting::preview() method is called for settings
* not handled as theme_mods or options.
*
* The dynamic portion of the hook name, $this->id, refers to the setting ID.
*
* @since 3.4.0
*/
do_action( 'customize_preview_' . $this->id );
}
}
@ -153,6 +162,15 @@ class WP_Customize_Setting {
if ( ! $this->check_capabilities() || ! isset( $value ) )
return false;
/**
* Fires when the WP_Customize_Setting::save() method is called for settings
* not handled as theme_mods or options.
*
* The dynamic portion of the hook name, $this->id_data['base'] refers to
* the base slug of the setting name.
*
* @since 3.4.0
*/
do_action( 'customize_save_' . $this->id_data[ 'base' ] );
$this->update( $value );
@ -190,6 +208,15 @@ class WP_Customize_Setting {
*/
public function sanitize( $value ) {
$value = wp_unslash( $value );
/**
* Filter a Customize setting value in un-slashed form.
*
* @since 3.4.0
*
* @param mixed $value Value of the setting.
* @param WP_Customize_Setting $this WP_Customize_Setting instance.
*/
return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
}
@ -210,6 +237,17 @@ class WP_Customize_Setting {
return $this->_update_option( $value );
break;
default :
/**
* Fires when the WP_Customize_Setting::update() method is called for settings
* not handled as theme_mods or options.
*
* The dynamic portion of the hook name, $this->type, refers to the type of setting.
*
* @since 3.4.0
*
* @param mixed $value Value of the setting.
*/
return do_action( 'customize_update_' . $this->type, $value );
}
}
@ -271,6 +309,20 @@ class WP_Customize_Setting {
$function = 'get_option';
break;
default :
/**
* Filter a Customize setting value not handled as a theme_mod or option.
*
* The dynamic portion of the hook name, $this->id_date['base'], refers to
* the base slug of the setting name.
*
* For settings handled as theme_mods or options, see those corresponding
* functions for available hooks.
*
* @since 3.4.0
*
* @param mixed $default The setting default value. Default empty.
*/
return apply_filters( 'customize_value_' . $this->id_data[ 'base' ], $this->default );
}
@ -291,6 +343,17 @@ class WP_Customize_Setting {
* @return mixed The requested escaped value.
*/
public function js_value() {
/**
* Filter a Customize setting value for use in JavaScript.
*
* The dynamic portion of the hook name, $this->id, refers to the setting ID.
*
* @since 3.4.0
*
* @param mixed $value The setting value.
* @param WP_Customize_Setting $this WP_Customize_Setting instance.
*/
$value = apply_filters( "customize_sanitize_js_{$this->id}", $this->value(), $this );
if ( is_string( $value ) )