Support » Themes and Templates » another arcane query about plugin hooks

another arcane query about plugin hooks

  • In the default and classic themes, the wp_head hook is called with <?php wp_head(); ?>. So, by analogy, wp_footer should be <?php wp_footer(); ?>, but when I do this I get an ‘undefined function’ parse error. Turns out that we have to use <?php do_action('wp_footer'); ?> instead. No problem with that, but why the different formats? These unexplained anomalies just make things harder for those of us who are trying to do things properly.

    I wonder how many of the current competition themes (other than those based on Kubrick) even bother with plugin hooks. Is it honestly worth my while to keep hammering away at this?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Do you know what wp_head() do? It calls do_action( 'wp_header' ).
    I guess someone forgot to do the same thing with footer hook.

    Well, that was illuminating. Thanks. Should I file it as a bug or take it that no-one cares?

    “Should I file it as a bug or take it that no-one cares?”

    Filing a bug would show that someone cares, right?

    Yes, but if the developers can’t be bothered to make the hooks consistent, and other theme-makers can’t be bothered to insert them, and plugin-makers can’t be bothered to use the hooks in the first place, that suggests I’d be the only person on the planet who did care. I haven’t yet slid far enough into geekery to be 100% comfortable with that level of sadness. Hell, I’m embarrassed that I cared enough to ask this question in the first place.

    pobody’s nerfect

    All I can say is, if users don’t ask, nicely but firmly and continuously, for developers, plugin writers and theme designers to stay consistent and use the functionality provided, then why should they bother?

    Moderator Ryan Boren


    WordPress Dev

    File a bug. I personally don’t like having do_action calls directly in templates and would prefer using wp_footer().

    Actually plugin authors love hooks, more the better. However hooks do come with slight penalty in performance. It is painful to ask someone to change code to make certain plugins work.

    I think you should file the bug.
    I have sometimes seen people in this forum get very emotional when you criticize their pet ideas/projects 🙂
    Nevertheless filing a bug is the right thing to do.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘another arcane query about plugin hooks’ is closed to new replies.
Skip to toolbar