[wp-hackers] echo and return

Stephen Minutillo steveminutillo at gmail.com
Tue Jul 27 16:20:54 UTC 2004


On Tue, 27 Jul 2004 09:06:15 -0700, Joseph Scott
<joseph at randomnetworks.com> wrote:
> 
> On Jul 27, 2004, at 8:17 AM, lowmagnet at lowmag.net wrote:
> 
> > It seems that this would become the syntax:
> >
> > <?php echo the_date(array("before" => "<h2>", "after" => "</h2>")); ?>
> >
> > Any takers on this technique?
> 
>         Nice to see someone brought this up.  If someone is tracking the votes
> I'd got for this option above the URL format.

By the way I think this style should not be used in general, only in
the very few cases where "normal" argument lists wouldn't work, for
whatever reason, for example if the argument list is very long, or too
many of the arguments are optional.  For example, 'the_date' doesn't
need named parameters, but arguably 'wp_list_cats' does.

And bringing this thread back around to the original topic, I agree
that there should be a convention for which functions echo directly to
the page, and which return strings.  For the "template tags", both
options should be available.  I'm not quite sure whether that
convention should be a standard parameter, or having two parallel sets
of functions, though.


Steve Minutillo



More information about the hackers mailing list