[wp-hackers] Inconsistent Functions?
peter.westwood at ftwr.co.uk
Sat Sep 9 15:25:48 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
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
> 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
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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the wp-hackers