always apply widget_title filter. Props Denis-de-Bernardy. fixes #9450
git-svn-id: http://svn.automattic.com/wordpress/trunk@11188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
14177ba3ef
commit
6d46bed194
|
@ -22,7 +22,7 @@ class WP_Widget_Pages extends WP_Widget {
|
||||||
function widget( $args, $instance ) {
|
function widget( $args, $instance ) {
|
||||||
extract( $args );
|
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'];
|
$sortby = empty( $instance['sortby'] ) ? 'menu_order' : $instance['sortby'];
|
||||||
$exclude = empty( $instance['exclude'] ) ? '' : $instance['exclude'];
|
$exclude = empty( $instance['exclude'] ) ? '' : $instance['exclude'];
|
||||||
|
|
||||||
|
@ -33,7 +33,8 @@ class WP_Widget_Pages extends WP_Widget {
|
||||||
|
|
||||||
if ( !empty( $out ) ) {
|
if ( !empty( $out ) ) {
|
||||||
echo $before_widget;
|
echo $before_widget;
|
||||||
echo $before_title . $title . $after_title;
|
if ( $title)
|
||||||
|
echo $before_title . $title . $after_title;
|
||||||
?>
|
?>
|
||||||
<ul>
|
<ul>
|
||||||
<?php echo $out; ?>
|
<?php echo $out; ?>
|
||||||
|
@ -203,10 +204,11 @@ class WP_Widget_Archives extends WP_Widget {
|
||||||
extract($args);
|
extract($args);
|
||||||
$c = $instance['count'] ? '1' : '0';
|
$c = $instance['count'] ? '1' : '0';
|
||||||
$d = $instance['dropdown'] ? '1' : '0';
|
$d = $instance['dropdown'] ? '1' : '0';
|
||||||
$title = empty($instance['title']) ? __('Archives') : apply_filters('widget_title', $instance['title']);
|
$title = apply_filters('widget_title', empty($instance['title']) ? __('Archives') : $instance['title']);
|
||||||
|
|
||||||
echo $before_widget;
|
echo $before_widget;
|
||||||
echo $before_title . $title . $after_title;
|
if ( $title )
|
||||||
|
echo $before_title . $title . $after_title;
|
||||||
|
|
||||||
if ( $d ) {
|
if ( $d ) {
|
||||||
?>
|
?>
|
||||||
|
@ -265,10 +267,11 @@ class WP_Widget_Meta extends WP_Widget {
|
||||||
|
|
||||||
function widget( $args, $instance ) {
|
function widget( $args, $instance ) {
|
||||||
extract($args);
|
extract($args);
|
||||||
$title = empty($instance['title']) ? __('Meta') : apply_filters('widget_title', $instance['title']);
|
$title = apply_filters('widget_title', empty($instance['title']) ? __('Meta') : $instance['title']);
|
||||||
|
|
||||||
echo $before_widget;
|
echo $before_widget;
|
||||||
echo $before_title . $title . $after_title;
|
if ( $title )
|
||||||
|
echo $before_title . $title . $after_title;
|
||||||
?>
|
?>
|
||||||
<ul>
|
<ul>
|
||||||
<?php wp_register(); ?>
|
<?php wp_register(); ?>
|
||||||
|
@ -312,8 +315,10 @@ class WP_Widget_Calendar extends WP_Widget {
|
||||||
|
|
||||||
function widget( $args, $instance ) {
|
function widget( $args, $instance ) {
|
||||||
extract($args);
|
extract($args);
|
||||||
$title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
|
$title = apply_filters('widget_title', empty($instance['title']) ? ' ' : $instance['title']);
|
||||||
echo $before_widget . $before_title . $title . $after_title;
|
echo $before_widget;
|
||||||
|
if ( $title )
|
||||||
|
echo $before_title . $title . $after_title;
|
||||||
echo '<div id="calendar_wrap">';
|
echo '<div id="calendar_wrap">';
|
||||||
get_calendar();
|
get_calendar();
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
@ -354,7 +359,7 @@ class WP_Widget_Text extends WP_Widget {
|
||||||
|
|
||||||
function widget( $args, $instance ) {
|
function widget( $args, $instance ) {
|
||||||
extract($args);
|
extract($args);
|
||||||
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title']);
|
||||||
$text = apply_filters( 'widget_text', $instance['text'] );
|
$text = apply_filters( 'widget_text', $instance['text'] );
|
||||||
echo $before_widget;
|
echo $before_widget;
|
||||||
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
|
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>
|
||||||
|
@ -408,13 +413,14 @@ class WP_Widget_Categories extends WP_Widget {
|
||||||
function widget( $args, $instance ) {
|
function widget( $args, $instance ) {
|
||||||
extract( $args );
|
extract( $args );
|
||||||
|
|
||||||
$title = empty( $instance['title'] ) ? __( 'Categories' ) : apply_filters('widget_title', $instance['title']);
|
$title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title']);
|
||||||
$c = $instance['count'] ? '1' : '0';
|
$c = $instance['count'] ? '1' : '0';
|
||||||
$h = $instance['hierarchical'] ? '1' : '0';
|
$h = $instance['hierarchical'] ? '1' : '0';
|
||||||
$d = $instance['dropdown'] ? '1' : '0';
|
$d = $instance['dropdown'] ? '1' : '0';
|
||||||
|
|
||||||
echo $before_widget;
|
echo $before_widget;
|
||||||
echo $before_title . $title . $after_title;
|
if ( $title )
|
||||||
|
echo $before_title . $title . $after_title;
|
||||||
|
|
||||||
$cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h);
|
$cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h);
|
||||||
|
|
||||||
|
@ -521,7 +527,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
|
||||||
ob_start();
|
ob_start();
|
||||||
extract($args);
|
extract($args);
|
||||||
|
|
||||||
$title = empty($instance['title']) ? __('Recent Posts') : apply_filters('widget_title', $instance['title']);
|
$title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title']);
|
||||||
if ( !$number = (int) $instance['number'] )
|
if ( !$number = (int) $instance['number'] )
|
||||||
$number = 10;
|
$number = 10;
|
||||||
else if ( $number < 1 )
|
else if ( $number < 1 )
|
||||||
|
@ -533,7 +539,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
|
||||||
if ($r->have_posts()) :
|
if ($r->have_posts()) :
|
||||||
?>
|
?>
|
||||||
<?php echo $before_widget; ?>
|
<?php echo $before_widget; ?>
|
||||||
<?php echo $before_title . $title . $after_title; ?>
|
<?php if ( $title ) echo $before_title . $title . $after_title; ?>
|
||||||
<ul>
|
<ul>
|
||||||
<?php while ($r->have_posts()) : $r->the_post(); ?>
|
<?php while ($r->have_posts()) : $r->the_post(); ?>
|
||||||
<li><a href="<?php the_permalink() ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?> </a></li>
|
<li><a href="<?php the_permalink() ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?> </a></li>
|
||||||
|
@ -614,7 +620,7 @@ class WP_Widget_Recent_Comments extends WP_Widget {
|
||||||
global $wpdb, $comments, $comment;
|
global $wpdb, $comments, $comment;
|
||||||
|
|
||||||
extract($args, EXTR_SKIP);
|
extract($args, EXTR_SKIP);
|
||||||
$title = empty($instance['title']) ? __('Recent Comments') : apply_filters('widget_title', $instance['title']);
|
$title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Comments') : $instance['title']);
|
||||||
if ( !$number = (int) $instance['number'] )
|
if ( !$number = (int) $instance['number'] )
|
||||||
$number = 5;
|
$number = 5;
|
||||||
else if ( $number < 1 )
|
else if ( $number < 1 )
|
||||||
|
@ -630,7 +636,7 @@ class WP_Widget_Recent_Comments extends WP_Widget {
|
||||||
$comments = array_slice( (array) $comments, 0, $number );
|
$comments = array_slice( (array) $comments, 0, $number );
|
||||||
?>
|
?>
|
||||||
<?php echo $before_widget; ?>
|
<?php echo $before_widget; ?>
|
||||||
<?php echo $before_title . $title . $after_title; ?>
|
<?php if ( $title ) echo $before_title . $title . $after_title; ?>
|
||||||
<ul id="recentcomments"><?php
|
<ul id="recentcomments"><?php
|
||||||
if ( $comments ) : foreach ( (array) $comments as $comment) :
|
if ( $comments ) : foreach ( (array) $comments as $comment) :
|
||||||
echo '<li class="recentcomments">' . /* translators: comments widget: 1: comment author, 2: post link */ sprintf(_x('%1$s on %2$s', 'widgets'), get_comment_author_link(), '<a href="' . clean_url( get_comment_link($comment->comment_ID) ) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
|
echo '<li class="recentcomments">' . /* translators: comments widget: 1: comment author, 2: post link */ sprintf(_x('%1$s on %2$s', 'widgets'), get_comment_author_link(), '<a href="' . clean_url( get_comment_link($comment->comment_ID) ) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
|
||||||
|
@ -716,10 +722,12 @@ class WP_Widget_RSS extends WP_Widget {
|
||||||
$title = apply_filters('widget_title', $title );
|
$title = apply_filters('widget_title', $title );
|
||||||
$url = clean_url(strip_tags($url));
|
$url = clean_url(strip_tags($url));
|
||||||
$icon = includes_url('images/rss.png');
|
$icon = includes_url('images/rss.png');
|
||||||
$title = "<a class='rsswidget' href='$url' title='" . attr(__('Syndicate this content')) ."'><img style='background:orange;color:white;border:none;' width='14' height='14' src='$icon' alt='RSS' /></a> <a class='rsswidget' href='$link' title='$desc'>$title</a>";
|
if ( $title )
|
||||||
|
$title = "<a class='rsswidget' href='$url' title='" . attr(__('Syndicate this content')) ."'><img style='background:orange;color:white;border:none;' width='14' height='14' src='$icon' alt='RSS' /></a> <a class='rsswidget' href='$link' title='$desc'>$title</a>";
|
||||||
|
|
||||||
echo $before_widget;
|
echo $before_widget;
|
||||||
echo $before_title . $title . $after_title;
|
if ( $title )
|
||||||
|
echo $before_title . $title . $after_title;
|
||||||
wp_widget_rss_output( $rss, $instance );
|
wp_widget_rss_output( $rss, $instance );
|
||||||
echo $after_widget;
|
echo $after_widget;
|
||||||
}
|
}
|
||||||
|
@ -967,10 +975,11 @@ class WP_Widget_Tag_Cloud extends WP_Widget {
|
||||||
|
|
||||||
function widget( $args, $instance ) {
|
function widget( $args, $instance ) {
|
||||||
extract($args);
|
extract($args);
|
||||||
$title = empty($instance['title']) ? __('Tags') : apply_filters('widget_title', $instance['title']);
|
$title = apply_filters('widget_title', empty($instance['title']) ? __('Tags') : $instance['title']);
|
||||||
|
|
||||||
echo $before_widget;
|
echo $before_widget;
|
||||||
echo $before_title . $title . $after_title;
|
if ( $title )
|
||||||
|
echo $before_title . $title . $after_title;
|
||||||
wp_tag_cloud();
|
wp_tag_cloud();
|
||||||
echo $after_widget;
|
echo $after_widget;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue