Created
June 21, 2013 19:39
-
-
Save michael-cannon/5833768 to your computer and use it in GitHub Desktop.
Filter testimonials_widget_validate_settings example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'testimonials_widget_validate_settings', array( &$this, 'validate_settings' ), 10, 2 ); | |
public static function validate_settings( $input, $errors = array(), $do_errors = false ) { | |
if ( ! empty( $input['clearcache'] ) ) { | |
Testimonials_Widget_Premium_Cache::clear_cache_all(); | |
unset( $input['clearcache'] ); | |
} | |
if ( empty( $do_errors ) ) { | |
$validated = $input; | |
} else { | |
$validated = array( | |
'input' => $input, | |
'errors' => $errors, | |
); | |
} | |
return $validated; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment