[wp-hackers] A template tag proposal

Kitty kitty at mookitty.co.uk
Tue Jul 27 18:37:54 UTC 2004


One thing that should be done, is to break out all the functions that
echo values and put them into 'functions-template-tags.php'.

Then, everything that is in it, would become an "official" template tag
could be conformed to a (proposed) standard:
- a prefix of "the_"
- will work 95% of the time w/o params being passed.
- when params are needed, they're URL style
- echos by default, can be overridden ('echo=false').
- only echos/returns strings.

This could become the "public interface" to WP and simplify life for the
casual blog builder w/o taking away any flexibility. Since a majority of
the existing template tag functions are in this ballpark, the breakage
would be minor, and easily fixed.

I've backtracked from originally saying that all functions should
return, not echo. Because this discussion pointed out that users want
template tags, and devs want returns. And have a standard template tag
interface would be best for users.

Also publishing a standard like this would make life easier for plugin
users. They would know that everything works in a similar way when a
plugin provides a template tag. (Providing that the plugin authors
followed the standard.)
-- 
Cheers!
Kitty <kitty at mookitty.co.uk>
http://blog.mookitty.co.uk/
http://mookitty.co.uk/devblog/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : /pipermail/hackers_wordpress.org/attachments/20040727/078462ff/attachment.bin


More information about the hackers mailing list