From 2a25e50450669b5e6e739263eab1acaa5164c23d Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 11 May 2009 19:48:56 +0000 Subject: [PATCH] Add title option to search widget. Props hakre. fixes #9756 git-svn-id: https://develop.svn.wordpress.org/trunk@11274 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/default-widgets.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index e8bd52cc9b..100c5752c7 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -179,13 +179,33 @@ class WP_Widget_Search extends WP_Widget { function widget( $args, $instance ) { extract($args); + $title = apply_filters('widget_title', $instance['title']); + echo $before_widget; + if ( $title ) + echo $before_title . $title . $after_title; // Use current theme search form if it exists get_search_form(); echo $after_widget; } + + function form( $instance ) { + $instance = wp_parse_args( (array) $instance, array( 'title' => '') ); + $title = $instance['title']; +?> +

+ '')); + $instance['title'] = strip_tags($new_instance['title']); + return $instance; + } + } /**