[wp-hackers] A template tag proposal

Alex nessence at gmail.com
Tue Jul 27 21:27:24 UTC 2004


Seems everything but URL style params would work. URL style params
would be too confusing with existing functions that accept a URL piece
which is recombined with a returned value. For instance,
wp_get_archives(). That function doesn't parse the given URL, it
appends it to the returned links. This would be much more confusing
than parameters. The templates are PHP scripts and template developers
should learn what parameters and arrays are. They are not complicated.

Same with the easytags. The templates should either be PHP or their
own language. They are all PHP as-is. If that changes, there will be
much bigger feats than tags and parameters.

On Tue, 27 Jul 2004 11:37:54 -0700, Kitty <kitty at mookitty.co.uk> wrote:
> 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/
> 
> 
>



More information about the hackers mailing list