From f98a2ed41d912c655c5af4e26d9fb81e2ee1b372 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 2 May 2016 22:42:26 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp-customize-setting.php | 8 +++++--- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-includes/class-wp-customize-setting.php b/wp-includes/class-wp-customize-setting.php index 1e29bdd458..94e7dedb0b 100644 --- a/wp-includes/class-wp-customize-setting.php +++ b/wp-includes/class-wp-customize-setting.php @@ -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 { diff --git a/wp-includes/version.php b/wp-includes/version.php index b1a5ffc7ea..cb7401fedd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.