Customize: Pass `WP_Customize_Setting` instance as second argument to `customize_value_{$id_base}` filter.

Adds parity with setting instance being passed as second argument to `customize_sanitize_{$id}` and `customize_sanitize_js_{$id}`. Allows the actual ID of the (multidimensional) setting value being filtered to be inspected.

Props celloexpressions, westonruter.
Fixes #36452.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2016-05-02 22:42:26 +00:00
parent 5f62db2f21
commit f98a2ed41d
2 changed files with 6 additions and 4 deletions

View File

@ -657,11 +657,13 @@ class WP_Customize_Setting {
* functions for available hooks.
*
* @since 3.4.0
* @since 4.6.0 Added the `$this` setting instance as the second param.
*
* @param mixed $default The setting default value. Default empty.
* @param mixed $default The setting default value. Default empty.
* @param WP_Customize_Setting $this The setting instance.
*/
$value = apply_filters( "customize_value_{$id_base}", $value );
} else if ( $this->is_multidimensional_aggregated ) {
$value = apply_filters( "customize_value_{$id_base}", $value, $this );
} elseif ( $this->is_multidimensional_aggregated ) {
$root_value = self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value'];
$value = $this->multidimensional_get( $root_value, $this->id_data['keys'], $this->default );
} else {

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37349';
$wp_version = '4.6-alpha-37350';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.