Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michael-cannon/5833768 to your computer and use it in GitHub Desktop.
Save michael-cannon/5833768 to your computer and use it in GitHub Desktop.
Filter testimonials_widget_validate_settings example
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