Customize: Ensure `customize_validate_{$setting->id}` filters apply on input post values for `WP_Customize_Setting` subclasses that neglect to apply the filter themselves.

Fixes #37638.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Weston Ruter 2016-10-09 20:08:32 +00:00
parent ffb703c002
commit 28795e8dc2
2 changed files with 8 additions and 1 deletions

View File

@ -1003,6 +1003,13 @@ final class WP_Customize_Manager {
continue;
}
$validity = $setting->validate( $unsanitized_value );
if ( ! is_wp_error( $validity ) ) {
/** This filter is documented in wp-includes/class-wp-customize-setting.php */
$late_validity = apply_filters( "customize_validate_{$setting->id}", new WP_Error(), $unsanitized_value, $setting );
if ( ! empty( $late_validity->errors ) ) {
$validity = $late_validity;
}
}
if ( ! is_wp_error( $validity ) ) {
$value = $setting->sanitize( $unsanitized_value );
if ( is_null( $value ) ) {

View File

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