[wp-hackers] substitutes for hook wp_footer ?

Otto otto at ottodestruct.com
Thu Jan 24 22:12:21 GMT 2008


Can't do it that way. What about feeds? They don't call the wp_footer.

I think that you probably shouldn't try to compensate for bad theme design.

On the other hand, if you have a config screen, you could search the
currently active theme's footer.php file for the "wp_footer" text and
warn the user if the theme doesn't have it. Bit of a long way to go,
but it would work.


On Jan 24, 2008 9:42 AM, Ozh <ozh at planetozh.com> wrote:
> Hello there
>
> A long run question I think amongst plugin devs: is there a way you can
> make sure something has been triggered by, say, wp_footer hook?
>
> If you want to be compatible with those pesky themes that miss their
> do_action('wp_footer')), would the following be acceptable ?
>
> function myplugin_dostuff() {
>         global $been_done;
>         if ($been_done) return;
>         // do stuff
>         // ...
>         $been_done = true;
> }
>
> add_action('wp_footer', 'myplugin_dostuff');
> add_action('shutdown', 'myplugin_dostuff');
>
> The obvious downside is that it would add output (like <script
> src="..."></script>) probably /after/ the closing </html> tag, but is
> there any better way to do things?
>
> Thanks for any idea you'd have.
>
> Ozh
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list