[wp-hackers] Detecting and fixing non-compliant themes

Viper007Bond viper at viper007bond.com
Fri Dec 29 01:29:55 GMT 2006


That's a very good method. Might just have to steal it! Good job. :)

On 12/28/06, Andy Skelton <skeltoac at gmail.com> wrote:
>
> On 12/21/06, Dan Kuykendall <dan at kuykendall.org> wrote:
> > For podPress I have to hook into the wp_head() call which should be in
> > the header.php and the wp_footer() in the footer.php
>
> This was a problem for me almost two years ago when I wrote my first
> plugins (CMC and BOTD) and the most common support request was from
> people with non-compliant themes.
>
> Here's an alternate idea for testing themes on activation. Similar to
> the way we call wp-cron, request home?hooktest=1.
>
> if ( isset($_GET['hooktest']) ) {
>   add_action('wp_head', 'wp_head_test', 99999);
>   add_action('shutdown', 'wp_hook_test');
> }
>
> function wp_head_test() {
>   define('WP_HEAD', true);
> }
>
> function wp_hook_test() {
>   update_option('hook_wp_head', constant('WP_HEAD'));
> }
>
> Thereafter, test get_option('hook_wp_head').
>
> Adding wp_footer is left as an exercise for the reader.
>
> Feel free to use this in your plugin or suggest a core implementation.
>
> Andy
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Viper007Bond | http://www.viper007bond.com/


More information about the wp-hackers mailing list