Wordpress: why is the init hook invoked multiple times?

后端 未结 2 868
走了就别回头了
走了就别回头了 2020-12-10 15:35

I am at a real loss at this problem. I just created a plug-in, and to log the actions in the plug-in (as I can\'t see the output of the processing), I added a hook to init l

2条回答
  •  攒了一身酷
    2020-12-10 15:48

    After Rob Williams' answer I've read this post:

    http://www.tastyplacement.com/how-to-remove-link-relprev-and-link-relnext-from-wordpress-head

    And realized that the link tags with rel="next" and rel="prev" was running my init hook for a second time on my WordPress 3.5.1 website. These tags can be removed adding this to the theme functions.php file:

    remove_filter('wp_head','adjacent_posts_rel_link_wp_head',10);
    

提交回复
热议问题