I like the structure, seems very easy to follow and work with.<br><br>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.<br>
<br>Just making sure I am getting my head wrapped around the example correctly ...<br><br><br>Cais.<br><br><div class="gmail_quote">On Wed, Oct 13, 2010 at 12:35 PM, Chip Bennett <span dir="ltr"><<a href="mailto:chip@chipbennett.net">chip@chipbennett.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I like the implementation, but we'll have to be careful about the assumptions.<div><br>
</div>
<div>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.).</div>
<div><br></div><div><font color="#888888">Chip<br><br></font><div class="gmail_quote"><div><div></div><div class="h5">On Wed, Oct 13, 2010 at 11:32 AM, Otto <span dir="ltr"><<a href="mailto:otto@ottodestruct.com" target="_blank">otto@ottodestruct.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">
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.<br>
<br>It's *very* simple at the moment though. I'll give you a quick example of a check I've written for it:<br><div><br></div><div>class Footer_Check implements themecheck {</div><div><span style="white-space: pre-wrap;">        </span>protected $error = null;</div>
<div><span style="white-space: pre-wrap;">        </span>function check( $php_files, $css_files, $other_files) {</div><div><span style="white-space: pre-wrap;">                </span>if( strpos( $php_files['footer.php'], 'wp_footer' ) === false ) {</div>
<div><span style="white-space: pre-wrap;">                        </span>$error = "The footer.php file does not have a wp_footer() call in it. This is required.";</div><div><span style="white-space: pre-wrap;">                        </span>return false;</div>
<div><span style="white-space: pre-wrap;">                </span>}<span style="white-space: pre-wrap;">        </span></div><div><span style="white-space: pre-wrap;">                </span>return true;</div><div>
<span style="white-space: pre-wrap;">        </span>}<span style="white-space: pre-wrap;">        </span></div><div><span style="white-space: pre-wrap;">        </span>function getError() { return $error; }</div>
<div>}</div><div>$themechecks[] = new Footer_Check;</div><div><br></div><div><br></div>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.<br>
<font color="#888888">
<br>-Otto<br><div><br></div>
</font><br></div></div><div class="im">_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org" target="_blank">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></div></blockquote></div><br></div>
<br>_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
<br></blockquote></div><br>