__( 'An animated search form', 'meh' ), 'classname' => 'mdl-search', ) ); } public function widget( $args, $instance ) { /* If a title was input by the user, display it. */ if ( ! empty( $instance['title'] ) ) { echo $args['before_title']; echo apply_filters( 'widget_title', $args['title'], $instance, $this->id_base ); echo $args['after_title']; } ?>
'Title', ) ); // Retrieve an existing value from the database $meh_title = !empty( $instance['meh_title'] ) ? $instance['meh_title'] : ''; // Form fields echo ''; echo ' '; echo ' '; echo '
'; } public function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['meh_title'] = !empty( $new_instance['meh_title'] ) ? strip_tags( $new_instance['meh_title'] ) : ''; return $instance; } } function meh_register_widgets() { register_widget( 'Mdl_Widget_Search' ); } add_action( 'widgets_init', 'meh_register_widgets' );