Make WordPress Core

Changeset 8902


Ignore:
Timestamp:
09/16/2008 04:52:47 AM (18 years ago)
Author:
ryan
Message:

Add echo option to wp_get_archives(). Props ShaneF. fixes #7749

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/general-template.php

    r8874 r8902  
    643643                'type' => 'monthly', 'limit' => '',
    644644                'format' => 'html', 'before' => '',
    645                 'after' => '', 'show_post_count' => false
     645                'after' => '', 'show_post_count' => false,
     646                'echo' => 1
    646647        );
    647648
    … …  
    698699                                if ( $show_post_count )
    699700                                        $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;
    701706                        }
    702707                }
    … …  
    719724                                if ($show_post_count)
    720725                                        $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;         
    722731                        }
    723732                }
    … …  
    741750                                if ($show_post_count)
    742751                                        $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;
    744757                        }
    745758                }
    … …  
    770783                                                if ($show_post_count)
    771784                                                        $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;
    773790                                        }
    774791                                }
    … …  
    795812                                        else
    796813                                                $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;
    798819                                }
    799820                        }
Note: See TracChangeset for help on using the changeset viewer.