From 69bc51b14ab124045fe8ce3192250a0b9e3226b6 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 11 May 2009 19:48:56 +0000 Subject: [PATCH] Add title option to search widget. Props hakre. fixes #9756 git-svn-id: http://svn.automattic.com/wordpress/trunk@11274 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 e8bd52cc9..100c5752c 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; + } + } /**