Support » Plugins » Problem with add_filter while developing a plugin

Viewing 4 replies - 1 through 4 (of 4 total)
    I’ve tried using a flag variable in session in order to execute the update_views only once. But it didn’t resolve the problem.

    Can you please run my code on your WordPress installation? By doing this, I’ll figure if it’s a configuration or coding problem.

    (sorry for my poor English ^^”’ )

    The problem was the default action:

    add_action(‘wp_head’, ‘adjacent_posts_rel_link’, 10, 0);

    in the file default-filters.php

    Inside the plugin code I’ve added:

    function remove_next_link(){
      remove_action('wp_head', 'adjacent_posts_rel_link');

    Now, why this strange behaviour?

    in addition to messing up obvious ways of generating page view counts, this is a significant performance hit (single.php loaded twice on nearly every post)

    Spent some time debugging.

    Tracked it to adjacent_posts_rel_link->get_permalink with permalinks set to ‘Month and name’. Inside get_permalink, the call to get_option(‘home’) appears to be the culprit.

    If permalinks are set to default, this does not happen.

    WP version 2.8.5

    Permalinks set to anything other than the default will trigger this action. I’m also seeing the same issue. Pre-loading an entire post just to get the permalink seems a little overkill when WordPress could get that from the wp_posts table using a query.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem with add_filter while developing a plugin’ is closed to new replies.