WordPress.org

Support

Support » How-To and Troubleshooting » Hook into comment-feed with add_action

Hook into comment-feed with add_action

  • Erunafailaro
    Member

    @erunafailaro

    Hi everyone!

    I wrote a little plugin to hook a statistic-tool into my feeds. Everytime my RSS- or ATOM-feeds are read, the call should be logged.

    In order to get this working, I registered a function to some of WP’s action by using the add_action funtion.

    This works for some actions, but I think I am still making a mistake when registering with the comment-feeds. Access to them is not logged. I think, there are some mistakes in my code.

    This is the code I am using:

    /* register my function via hook*/
    /* the following five lines are working */
    add_action('wp_head', 'slimstat_hook');
    add_action('atom_head', 'slimstat_hook');
    add_action('rdf_header', 'slimstat_hook');
    add_action('rss_head', 'slimstat_hook');
    add_action('rss2_head', 'slimstat_hook');
    
    /* the following two lines are not working */
    add_action('do_feed_rss2(true)', 'slimstat_hook');
    add_action('do_feed_atom(true)', 'slimstat_hook');

    Could anyone tell me how to register an action with comment-feeds?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Hook into comment-feed with add_action’ is closed to new replies.