[wp-hackers] a plugin of a theme's own

David House dmhouse at gmail.com
Tue Sep 20 16:46:35 GMT 2005


On 20/09/05, Andy Skelton <skeltoac at gmail.com> wrote:
> On 9/20/05, David Chait <davebytes at comcast.net> wrote:
> > If it makes it conceptually easier for people, why not have a
> > [theme]/plugins/ optional subfolder?  If there are files there, treat them
> > as 'second pass' plugins during the plugin-load process.  I think that's the
> > proper 'container' direction (aside from moving to an actual container, i.e.
> > zipped format of some sort...).  And it makes more sense than some file
> > named 'functions.php' in the theme folder (there's already a ton of php
> > files).  People would understand a folder named 'plugins', I'd think!
> 
> David, functions.php is not a plugin. It is a file that contains
> functions that the theme author can use in the theme and/or in admin
> panels. It helps one separate logic and presentation.

I've think you've nailed it there. functions.php allows authors to
seperate their logic from the actual templates. Think of it as the
equivalent to a 'helper' file in MVC format (if you've used Rails
before, this will be familiar, but if not, the helper files are
essentially a load of functions which supplement the display logic).

On 20/09/05, Trevor Turk <trevorturk at yahoo.com> wrote:
> Something I was thinking about, on a related note,
> would be to consider making a "standardized" or
> at-least 'recommended" way to show an options page for
> the current theme. This work with the Kubrick theme
> and the new k2 theme's options page are already
> showing up with different titles, etc.

As Andy said, we have add_theme_page(). This adds an options page in a
standardised place. While we don't standardise the name of this page
(plugin authors can specify this), I don't think this would be too big
a problem.

-- 
-David House, dmhouse at gmail.com, http://xmouse.ithium.net


More information about the wp-hackers mailing list