[theme-reviewers] Functions.php Worm
Edward Caissie
edward.caissie at gmail.com
Wed Oct 13 16:50:39 UTC 2010
I like the structure, seems very easy to follow and work with.
As to the example, it appears to be checking to see if wp_footer exists in
the footer.php file which is where wp_footer() should be located if
footer.php exists ... that does not mean to say it cannot exist elsewhere,
but it must exist in footer.php.
Just making sure I am getting my head wrapped around the example correctly
...
Cais.
On Wed, Oct 13, 2010 at 12:35 PM, Chip Bennett <chip at chipbennett.net> wrote:
> I like the implementation, but we'll have to be careful about the
> assumptions.
>
> For example: wp_footer() will NOT always be in footer.php. It can
> (legitimately) be in index.php (or any hierarchical template file
> (archive.php, page.php, attachment.php, 404.php, etc.).
>
> Chip
>
> On Wed, Oct 13, 2010 at 11:32 AM, Otto <otto at ottodestruct.com> wrote:
>
>> Well, regardless, I do have a simple structure I've been working on to
>> make the theme checker more easily expandable. It uses a simple class based
>> mechanism to allow us to easily add theme checks in on-the-fly. I'll have
>> something soon to demonstrate and hopefully allow people to help me write
>> the checks for it.
>>
>> It's *very* simple at the moment though. I'll give you a quick example of
>> a check I've written for it:
>>
>> class Footer_Check implements themecheck {
>> protected $error = null;
>> function check( $php_files, $css_files, $other_files) {
>> if( strpos( $php_files['footer.php'], 'wp_footer' ) === false ) {
>> $error = "The footer.php file does not have a wp_footer() call in it.
>> This is required.";
>> return false;
>> }
>> return true;
>> }
>> function getError() { return $error; }
>> }
>> $themechecks[] = new Footer_Check;
>>
>>
>> That code adds the wp_footer check in and any incoming themes will then
>> get run through it. Adding new checks is as simple as creating one of those
>> and popping it in a new file in the right place. No limit on number of
>> checks. All errors found will be returned.
>>
>> -Otto
>>
>>
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>
>>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20101013/429a6f5a/attachment.htm>
More information about the theme-reviewers
mailing list