[wp-docs] Differences between Template Tags and Functions
MichaelH
justmichaelh at gmail.com
Thu May 29 12:28:18 GMT 2008
From: "Ozh" <ozh at planetozh.com>
> >My question is, where do you draw the line between functions (which
>>developers look for) and template tags which non-developers look for?
>
> The border line is indeed virtually inexistant. I would say: let's keep it
> the least confusing for inexperienced developpers (who are going to look
> primarily at the codex), while more experienced coders will also dig a bit
> around and look into the source.
>
> My proposal for: what a function needs to qualify as a Template Tag :
> - being located in one of the *-template.php files
> - echoing something, not returning something
> - having a "non scary" self explanatory name (the_category(): ok,
> _usort_terms_by_ID(): not ok)
>
> I think this would be the most natural classification for beginners.
>
> (Therefore, I think wp_count_posts() does not deserve its "Kiss Me I'm a
> Template Tag" badge, sorry!)
Good explanation. I plead guilty to starting that as a Template Tag article.
I've moved that to the Function Reference section [1].
Regards.
[1] http://codex.wordpress.org/Function_Reference/wp_count_posts
MichaelH
More information about the wp-docs
mailing list