[wp-hackers] Inconsistent Functions?

Peter Westwood peter.westwood at ftwr.co.uk
Sat Sep 9 15:25:48 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joakim Stai wrote:
> I'm new to the development side of WordPress as well (hello all :)), and
> I've noticed the same thing. Doing it the single_cat_title('prefix',
> 'display') way is in my opinion the preferred solution, it's much easier
> for
> the template designers to work with a single function for both displaying
> and returning the value, than to use two different functions.
> 
> Why can't one make the_time() and get_the_time() identical, except have the
> one return and the other display the value as default? For example
> the_time($d='', display=true) and get_the_time($d='', display=false)? After
> all the_time() is a wrapper function for get_the_time() which again uses
> get_post_time(). Then template designers can use both functions in the same
> way, and older templates won't be affected because of the default display
> parameter. The same applies to other similar functions.
> 

The WordPress way favours the current way get_the_time and the_time work
I believe.

WordPress Template tags in general are designed to work without you
supplying any arguments getting a sensible default result.

The ones that do take arguments are tending towards query string style
over argument lists as it makes it _much_ easier to provide just the
arguments that you are interested in.

westi
- --
Peter Westwood
http://blog.ftwr.co.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFAtz8VPRdzag0AcURAg95AKCJSiQF/uZT//QDwP/isReVOlWm2QCaA8NV
eWdka5IW9xCWBT1gvHVgnp4=
=9dra
-----END PGP SIGNATURE-----



More information about the wp-hackers mailing list