WordPress.org

Ready to get started?Download WordPress

Forums

Hook into comment-feed with add_action (2 posts)

  1. Erunafailaro
    Member
    Posted 6 years ago #

    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?

  2. Erunafailaro
    Member
    Posted 6 years ago #

    hmm ... no ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic