[wp-hackers] Regarding wp markup language
Jeremy Clarke
jer at simianuprising.com
Sat Apr 17 17:04:49 UTC 2010
I think we can all agree that the template tags system WP uses, which
mixes php with html using the normal <?php ?> tags is not a terrible
one, if only because WP is so damn popular with so many kinds of
people. Further, when working in an environment like WP you're
probably better off using the standard practice even if it weren't the
best one imaginable.
FWIW I think "WPML" does already exist in the form of the template
tags. Yes, they are PHP functions, but at the same time they have been
crafted with the user in mind and specifically with templating in
mind. We take for granted (or maybe curse) "The Loop" and its assumed
global $post; in all of the the_* and get_the_* functions, but that is
not an accident. It is a conscious effort to make calling the display
functions as simple as possible within the context of raw PHP,
specifically by removing the need to pass in arguments whenever
possible.
The only things that aren't dead-simple to insert into themes are the
stuff that would be super-complicated to do even with a markup
language, the loop itself. In my case I write wrapper functions for
that stuff then call it in the templates, stuff like
gv_display_post_archive() or gv_display_recent_headlines(). IMHO that
is an area where WP has room to improve: it should offer default loop
etc functions that can be overridden by themers in functions.php or
plugins, similar to how the Comments system works now. I saw a trac
ticket in this vein at some point but can't find it now.
--
Jeremy Clarke | http://jeremyclarke.org
Code and Design | http://globalvoicesonline.org
More information about the wp-hackers
mailing list