Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: customize_validate_{$setting->id}

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1989                     $validity = new WP_Error( 'unauthorized', __( 'Unauthorized to modify setting due to capability.' ) );
1990                } else {
1991                     if ( is_null( $unsanitized_value ) ) {
1992                          continue;
1993                     }
1994                     $validity = $setting->validate( $unsanitized_value );
1995                }
1996                if ( ! is_wp_error( $validity ) ) {
1997                     /** This filter is documented in wp-includes/class-wp-customize-setting.php */
1998                     $late_validity = apply_filters( "customize_validate_{$setting->id}", new WP_Error(), $unsanitized_value, $setting );
1999                     if ( ! empty( $late_validity->errors ) ) {
2000                          $validity = $late_validity;
2001                     }
2002                }
2003                if ( ! is_wp_error( $validity ) ) {
2004                     $value = $setting->sanitize( $unsanitized_value );
2005                     if ( is_null( $value ) ) {
2006                          $validity = false;
2007                     } elseif ( is_wp_error( $value ) ) {