• I’m sorry this is a total noob question but I would like to use Subscribe2 to allow users to receive email posts when a post has been assigned a particular tag. I reviewed an earlier support post that showed that the s2_taxonomies filter from the API would do this. The code referenced was the following.

    function my_taxonomy_types($taxonomies) {
        %taxonomies = array('post tag');
        return $taxonomies;
    }
    add_filter('s2_taxonomies', 'my_taxonomy_types');

    My problem is that I have no idea where to put this code in order to implement it. I’ve tried putting the code in my theme’s function.php code and have also created what I believe to be a plugin extension but I’m not sure if that’s right or where to go to see if it worked.

    Any help would be greatly appreciated.

    https://ww.wp.xz.cn/plugins/subscribe2/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi jwbergy,

    either location should work, plugin or functions.php

    You can try email log plugin to see whether email is generated when you add the category to the post

    Thread Starter jwbergy

    (@jwbergy)

    tanaylakani,

    Thank you for the response. I’m not sure I understand though. My goal is to allow my users to subscribe to particular tags and receive emails when new posts are published with those tags. I was under the impression that the above code would help facilitate that. If that is true, my problem is that I’m not sure what else I need to do to get it so that I can match subscribers to tags. I this something I can do in the subscribe2 user interface or do I need to do that somewhere else. Sorry if these are silly questions but I’m new to trying to extend the functionality of word press and word press plugins.

    @jwbergy,

    The code you pasted above contains syntax errors – a % instead of a $ on the first line of the function.

    Also, the slug name for the tags should probably have an underscore instead of a space.

    Thread Starter jwbergy

    (@jwbergy)

    Thanks mattryrob,

    I fixed those errors and have activated the code as a plugin extension. I’m not sure what to do next to set up my subscribers to receive emails based on a post’s tags. Do I have to do something in the code are should there be additional options in the admin console? Any help would be greatly appreciated.

    Jim

    @jim,

    Once registered you should see that the ‘category’ names have changed in the Subscribe2->Your Subscriptions page. That’s it.

    Thread Starter jwbergy

    (@jwbergy)

    Matt — I got it to work. Thank you very much for you help.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Implementing s2_taxonomies’ is closed to new replies.