[wp-hackers] get_template function
Sam Angove
sam at rephrase.net
Mon Mar 20 00:50:24 GMT 2006
On 3/20/06, Ross Crawford <ross.crawford at gmail.com> wrote:
>
> Comments?
>
I realize it's in the current functions too, but is there a good
reason to fall back on the default theme if the file isn't found? I
mean, as an end-user, I don't have a perception that the default theme
is any different than any other theme, so it's pretty unexpected
behaviour. (Maybe I deleted 'sidebar.php' because I decided that I
didn't want a sidebar at all?)
So my vote goes for something like:
function get_template($type) {
if ( $template = get_query_template($type) )
load_template($template);
}
Either way it'd be good to use get_query_template(), so we get the
"{$type}_template" filters that are already used everywhere else.
More information about the wp-hackers
mailing list