[wp-hackers] Returning instead of echoing

Mark Jaquith mark.wordpress at txfx.net
Mon Nov 8 05:31:11 UTC 2004


David House wrote:

>See previous discussion. We've had a huge thread [1] on this topic already. I
>had a proposal [2] which I still think is a good idea. It would probably be
>worth extract()ing this array inside the function, so inside the function you
>can use $foo instead of $args['foo']. Of course, using compact() as a way of
>creating the parameter-arrays is a good idea as well.
>
I thought it was a great idea, and still do.  This was one of the first 
things about WordPress that I noticed when I started first examining the 
code.  A lot of my early hacking involved taking existing functions, 
adding "get_" to the front of the function name, and changing the echoes 
into returns, and saving in my-hacks.php.  I absolutely empathize with 
newbies who may be confused by "echo," but really, what newbie 
understands <?php function(); ?>  right away?  I think that if we can 
expect them to pick up that much syntax, we can reasonably expect them 
to catch on to "echo."  David also has many good ideas on different ways 
this issue can be fixed.  None may be ideal, but I think method 5 is the 
best option.  I don't want to start a big thing, but the last time this 
came up, there was really no resolution or closure.  The people 
subscribed to this list are the people who help expand WordPress's 
capabilities through hacks and plugins, and this is an issue that, if 
resolved, would make life a whole lot easier for us.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/hackers_wordpress.org/attachments/20041108/539a0c20/attachment.htm


More information about the hackers mailing list