[wp-docs] Differences between Template Tags and Functions

Ozh ozh at planetozh.com
Thu May 29 08:42:02 GMT 2008


>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!)

Cheers,

Ozh


More information about the wp-docs mailing list