How do I display an error in the form, a flash message or someway, indicating what he did wrong?
The code is something like this:
class My_Widget extends WP_Widget {
public function update( $new_instance, $old_instance ) {
if (!valid($new_instance))
// How do I notify the user with a custom message
return false;
else
return $new_instance
}
}
I know that returning false prevents the options from being saved, but the user won't know why.