Ticket #9450: 9450.diff
File 9450.diff, 6.5 KB (added by , 15 years ago) |
---|
-
wp-includes/default-widgets.php
22 22 function widget( $args, $instance ) { 23 23 extract( $args ); 24 24 25 $title = empty( $instance['title'] ) ? __( 'Pages' ) : apply_filters('widget_title',$instance['title']);25 $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Pages' ) : $instance['title']); 26 26 $sortby = empty( $instance['sortby'] ) ? 'menu_order' : $instance['sortby']; 27 27 $exclude = empty( $instance['exclude'] ) ? '' : $instance['exclude']; 28 28 … … 33 33 34 34 if ( !empty( $out ) ) { 35 35 echo $before_widget; 36 echo $before_title . $title . $after_title; 36 if ( $title) 37 echo $before_title . $title . $after_title; 37 38 ?> 38 39 <ul> 39 40 <?php echo $out; ?> … … 203 204 extract($args); 204 205 $c = $instance['count'] ? '1' : '0'; 205 206 $d = $instance['dropdown'] ? '1' : '0'; 206 $title = empty($instance['title']) ? __('Archives') : apply_filters('widget_title',$instance['title']);207 $title = apply_filters('widget_title', empty($instance['title']) ? __('Archives') : $instance['title']); 207 208 208 209 echo $before_widget; 209 echo $before_title . $title . $after_title; 210 if ( $title ) 211 echo $before_title . $title . $after_title; 210 212 211 213 if ( $d ) { 212 214 ?> … … 265 267 266 268 function widget( $args, $instance ) { 267 269 extract($args); 268 $title = empty($instance['title']) ? __('Meta') : apply_filters('widget_title',$instance['title']);270 $title = apply_filters('widget_title', empty($instance['title']) ? __('Meta') : $instance['title']); 269 271 270 272 echo $before_widget; 271 echo $before_title . $title . $after_title; 273 if ( $title ) 274 echo $before_title . $title . $after_title; 272 275 ?> 273 276 <ul> 274 277 <?php wp_register(); ?> … … 312 315 313 316 function widget( $args, $instance ) { 314 317 extract($args); 315 $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']); 316 echo $before_widget . $before_title . $title . $after_title; 318 $title = apply_filters('widget_title', empty($instance['title']) ? ' ' : $instance['title']); 319 echo $before_widget; 320 if ( $title ) 321 echo $before_title . $title . $after_title; 317 322 echo '<div id="calendar_wrap">'; 318 323 get_calendar(); 319 324 echo '</div>'; … … 354 359 355 360 function widget( $args, $instance ) { 356 361 extract($args); 357 $title = empty($instance['title']) ? '' : apply_filters('widget_title',$instance['title']);362 $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title']); 358 363 $text = apply_filters( 'widget_text', $instance['text'] ); 359 364 echo $before_widget; 360 365 if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?> … … 408 413 function widget( $args, $instance ) { 409 414 extract( $args ); 410 415 411 $title = empty( $instance['title'] ) ? __( 'Categories' ) : apply_filters('widget_title',$instance['title']);416 $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title']); 412 417 $c = $instance['count'] ? '1' : '0'; 413 418 $h = $instance['hierarchical'] ? '1' : '0'; 414 419 $d = $instance['dropdown'] ? '1' : '0'; 415 420 416 421 echo $before_widget; 417 echo $before_title . $title . $after_title; 422 if ( $title ) 423 echo $before_title . $title . $after_title; 418 424 419 425 $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h); 420 426 … … 521 527 ob_start(); 522 528 extract($args); 523 529 524 $title = empty($instance['title']) ? __('Recent Posts') : apply_filters('widget_title',$instance['title']);530 $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title']); 525 531 if ( !$number = (int) $instance['number'] ) 526 532 $number = 10; 527 533 else if ( $number < 1 ) … … 533 539 if ($r->have_posts()) : 534 540 ?> 535 541 <?php echo $before_widget; ?> 536 <?php echo $before_title . $title . $after_title; ?>542 <?php if ( $title ) echo $before_title . $title . $after_title; ?> 537 543 <ul> 538 544 <?php while ($r->have_posts()) : $r->the_post(); ?> 539 545 <li><a href="<?php the_permalink() ?>"><?php if ( get_the_title() ) the_title(); else the_ID(); ?> </a></li> … … 614 620 global $wpdb, $comments, $comment; 615 621 616 622 extract($args, EXTR_SKIP); 617 $title = empty($instance['title']) ? __('Recent Comments') : apply_filters('widget_title',$instance['title']);623 $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Comments') : $instance['title']); 618 624 if ( !$number = (int) $instance['number'] ) 619 625 $number = 5; 620 626 else if ( $number < 1 ) … … 630 636 $comments = array_slice( (array) $comments, 0, $number ); 631 637 ?> 632 638 <?php echo $before_widget; ?> 633 <?php echo $before_title . $title . $after_title; ?>639 <?php if ( $title ) echo $before_title . $title . $after_title; ?> 634 640 <ul id="recentcomments"><?php 635 641 if ( $comments ) : foreach ( (array) $comments as $comment) : 636 642 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 722 $title = apply_filters('widget_title', $title ); 717 723 $url = clean_url(strip_tags($url)); 718 724 $icon = includes_url('images/rss.png'); 719 $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>"; 725 if ( $title ) 726 $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>"; 720 727 721 728 echo $before_widget; 722 echo $before_title . $title . $after_title; 729 if ( $title ) 730 echo $before_title . $title . $after_title; 723 731 wp_widget_rss_output( $rss, $instance ); 724 732 echo $after_widget; 725 733 } … … 967 975 968 976 function widget( $args, $instance ) { 969 977 extract($args); 970 $title = empty($instance['title']) ? __('Tags') : apply_filters('widget_title',$instance['title']);978 $title = apply_filters('widget_title', empty($instance['title']) ? __('Tags') : $instance['title']); 971 979 972 980 echo $before_widget; 973 echo $before_title . $title . $after_title; 981 if ( $title ) 982 echo $before_title . $title . $after_title; 974 983 wp_tag_cloud(); 975 984 echo $after_widget; 976 985 }