[wp-hackers] Inconsistent Functions?

Joakim Stai joakimstai at gmail.com
Sat Sep 9 14:59:52 GMT 2006


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.

Just my 2 cents.. Hope I can contribute and give back to the wonderful
WordPress community :)

-Joakim

On 9/9/06, mike at hitori.org <mike at hitori.org> wrote:
>
> Good day,
>
> I'm rather new to the WordPress development area, but looking at the API,
> I've found it to be slightly inconsistent?
>
> An example of what I'm talking about are these two functions:
> * the_time($f) vs get_the_time($f) -- to print vs return a date/time for a
> post
> * single_cat_title('prefix', 'display') -- set 'display' to true or false
> to either display or return the value
>
> I'm wondering if there's a desire to move 'all' the functions to one or
> the other method of doing things?
>
> Cheers,
> Mike
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list