Ticket #7749: 7749.1.diff
File 7749.1.diff, 2.5 KB (added by , 17 years ago) |
---|
-
wp-includes/general-template.php
642 642 $defaults = array( 643 643 'type' => 'monthly', 'limit' => '', 644 644 'format' => 'html', 'before' => '', 645 'after' => '', 'show_post_count' => false 645 'after' => '', 'show_post_count' => false, 646 'echo' => 1 646 647 ); 647 648 648 649 $r = wp_parse_args( $args, $defaults ); … … 697 698 $text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year); 698 699 if ( $show_post_count ) 699 700 $after = ' ('.$arcresult->posts.')' . $afterafter; 700 echo get_archives_link($url, $text, $format, $before, $after); 701 $output = get_archives_link($url, $text, $format, $before, $after); 702 if ( $echo ) 703 echo $output; 704 else 705 return $output; 701 706 } 702 707 } 703 708 } elseif ('yearly' == $type) { … … 718 723 $text = sprintf('%d', $arcresult->year); 719 724 if ($show_post_count) 720 725 $after = ' ('.$arcresult->posts.')' . $afterafter; 721 echo get_archives_link($url, $text, $format, $before, $after); 726 $output = get_archives_link($url, $text, $format, $before, $after); 727 if ( $echo ) 728 echo $output; 729 else 730 return $output; 722 731 } 723 732 } 724 733 } elseif ( 'daily' == $type ) { … … 740 749 $text = mysql2date($archive_day_date_format, $date); 741 750 if ($show_post_count) 742 751 $after = ' ('.$arcresult->posts.')'.$afterafter; 743 echo get_archives_link($url, $text, $format, $before, $after); 752 $output = get_archives_link($url, $text, $format, $before, $after); 753 if ( $echo ) 754 echo $output; 755 else 756 return $output; 744 757 } 745 758 } 746 759 } elseif ( 'weekly' == $type ) { … … 769 782 $text = $arc_week_start . $archive_week_separator . $arc_week_end; 770 783 if ($show_post_count) 771 784 $after = ' ('.$arcresult->posts.')'.$afterafter; 772 echo get_archives_link($url, $text, $format, $before, $after); 785 $output = get_archives_link($url, $text, $format, $before, $after); 786 if ( $echo ) 787 echo $output; 788 else 789 return $output; 773 790 } 774 791 } 775 792 } … … 794 811 $text = strip_tags(apply_filters('the_title', $arc_title)); 795 812 else 796 813 $text = $arcresult->ID; 797 echo get_archives_link($url, $text, $format, $before, $after); 814 $output = get_archives_link($url, $text, $format, $before, $after); 815 if ( $echo ) 816 echo $output; 817 else 818 return $output; 798 819 } 799 820 } 800 821 }