From eb4fd7e4f6cba0e50b0a499822bd9d67370b02e8 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 5 May 2009 03:59:08 +0000 Subject: [PATCH] always apply widget_title filter. Props Denis-de-Bernardy. fixes #9450 git-svn-id: https://develop.svn.wordpress.org/trunk@11188 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/default-widgets.php | 47 ++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index 85e2975104..a4b86d25e4 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -22,7 +22,7 @@ class WP_Widget_Pages extends WP_Widget { function widget( $args, $instance ) { extract( $args ); - $title = empty( $instance['title'] ) ? __( 'Pages' ) : apply_filters('widget_title', $instance['title']); + $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Pages' ) : $instance['title']); $sortby = empty( $instance['sortby'] ) ? 'menu_order' : $instance['sortby']; $exclude = empty( $instance['exclude'] ) ? '' : $instance['exclude']; @@ -33,7 +33,8 @@ class WP_Widget_Pages extends WP_Widget { if ( !empty( $out ) ) { echo $before_widget; - echo $before_title . $title . $after_title; + if ( $title) + echo $before_title . $title . $after_title; ?>