Title: Using with Custom Post Type
Last modified: August 24, 2016

---

# Using with Custom Post Type

 *  [Auk](https://wordpress.org/support/users/auk/)
 * (@auk)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/)
 * I have a custom post type of “monthly bulletin” that I need to send to subscribers.
   
   I’ve added the code below into my functions.php file, and tested it by publishing
   a new bulletin, but the email notification doesn’t come through.
 * Any ideas on what I am missing?
 *     ```
       function my_post_types($types) {
           $types[] = 'monthlybulletin';
           return $types;
       }
       add_filter('s2_post_types', 'monthlybulletin');
       ```
   
 * I’ve tested the plugin with a standard post and that works fine.
 * Thanks in advance.
 * [https://wordpress.org/plugins/subscribe2/](https://wordpress.org/plugins/subscribe2/)

Viewing 15 replies - 1 through 15 (of 34 total)

1 [2](https://wordpress.org/support/topic/using-with-custom-post-type-1/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/using-with-custom-post-type-1/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/using-with-custom-post-type-1/page/2/?output_format=md)

 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004513)
 * [@auk](https://wordpress.org/support/users/auk/)
 * On the add_filter() first item inside the brackets is the hook you are linking
   to and the second part is the name of the function you are hooking. In the case
   you’ve change that to the name of your custom post type rather than the function
   that is called to register the custom post type.
 * Change that to the function name or rename the function and it should work.
 *  [bruinkid](https://wordpress.org/support/users/bruinkid/)
 * (@bruinkid)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004681)
 * Hi,
 * This is mine. It works. my post type name is ‘job’
 * // add job post type to subscribe2
    function jobs($types) { $types[] = ‘job’;
   return $types; }
 * add_filter(‘s2_post_types’, ‘jobs’);
 *  [bruinkid](https://wordpress.org/support/users/bruinkid/)
 * (@bruinkid)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004682)
 * [https://subscribe2.wordpress.com/2011/02/28/subscribe2-and-custom-post-types/](https://subscribe2.wordpress.com/2011/02/28/subscribe2-and-custom-post-types/)
 *  [physalis](https://wordpress.org/support/users/physalis/)
 * (@physalis)
 * [11 years ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004744)
 * Oh, well, how can I actually see that this is working? It is unfortunately not
   showing custom taxonomies of those post types, so I cannot configure it to shoot
   when a post in a specific category of a custom post type is being published.
 *  [physalis](https://wordpress.org/support/users/physalis/)
 * (@physalis)
 * [11 years ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004745)
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [11 years ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004746)
 * [@physalis](https://wordpress.org/support/users/physalis/)
 * Once correctly registered a custom post type will be displayed on the Subscribe2-
   >Settings page in the first ran. Once a taxonomy is registered you should see
   the names listed in the Registered Users tab or in your own Your Subscriptions
   page.
 *  [physalis](https://wordpress.org/support/users/physalis/)
 * (@physalis)
 * [11 years ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004747)
 * Hi [@mattyrob](https://wordpress.org/support/users/mattyrob/),
 * thanks for your quick reply :). However, unfortunately I cannot see these taxonomy
   terms anywhere, but the custom post type I need to use the taxonomy with is showing
   on the settings page directly. However, none of the taxonomy terms show up in
   the general settings, Registered user and my own settings, weird. Does the taxonomy
   have some kind of a special name?
 *  [physalis](https://wordpress.org/support/users/physalis/)
 * (@physalis)
 * [11 years ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004748)
 * However, on a side note, I have another custom post type which I had built myself
   through functions.php that isn’t showing at all on the settings page. What requirements
   does a CPT have in order to show up in your settings (I don’t need notifications
   for that, but maybe it is connected somehow)?
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [11 years ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004749)
 * [@physalis](https://wordpress.org/support/users/physalis/)
 * CPT and taxonomies don’t need any special characteristics. They just need registering
   in Subscribe2. Have you done that? Can you post your code?
 *  [physalis](https://wordpress.org/support/users/physalis/)
 * (@physalis)
 * [11 years ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004750)
 * Oh wait, yes, I registered the post type, though not its taxonomies. Should I
   do that as well? Didn’t find anything for taxonomies…
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [11 years ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004751)
 * [@physalis](https://wordpress.org/support/users/physalis/)
 * Yes, you need to register both. The API is documented here:
    [https://subscribe2.wordpress.com/support/api/](https://subscribe2.wordpress.com/support/api/)
 * You’ll need the ‘s2_taxonomies’ filter hook.
 *  [physalis](https://wordpress.org/support/users/physalis/)
 * (@physalis)
 * [11 years ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004752)
 * Aaaaah, well, thank you so much, THAT worked fine. I can finally see the terms
   on each user’s subscribe settings. However, maybe I am still doing something 
   wrong:
 * a) If I use the original settings of the plugin, the frontend submissions create‘
   pending’ posts, and Subscribe2 ignores them. Notifications only get triggered
   when I set them to publish immediately. Is there any screw I can turn to make
   it recognise pending posts that are coming from the frontend?
 * b) I have set up two users to one example term each (categories), i.e. user1 
   gets notified on a new post in category1, user2 gets notified on a new post in
   category2. However, when I post to either category, both users get equally notified,
   i.e. it does seem to ignore which one of the taxonomies the user is subscribed
   to. May I just miss something here?
 * Thanks again,
 * physalis
 *  [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * (@mattyrob)
 * [11 years ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004753)
 * [@physalis](https://wordpress.org/support/users/physalis/)
 * For the first issue you need to use the ‘s2_post_statuses’ hook to tell Subscribe2
   to act on posts made to the pending status.
 * The second issue I’m not sure I can explain. It may be down to the way the COT
   and taxonomy are created. They need to have a heirarchy.
 *  [physalis](https://wordpress.org/support/users/physalis/)
 * (@physalis)
 * [11 years ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004754)
 * Hi [@mattyrob](https://wordpress.org/support/users/mattyrob/),
 * thanks a ton again.
 * You just found what seems to be the problem – the post type has a non-hierarchical,
   thus tag-based taxonomy even though they call it category. The funny thing is
   that they even have a separate taxonomy for tags.
 * Well well, is there a way to include a non-hierarchical taxonomy to trigger notifications?
 *  [physalis](https://wordpress.org/support/users/physalis/)
 * (@physalis)
 * [11 years ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/#post-6004755)
 * Hi [@mattyrob](https://wordpress.org/support/users/mattyrob/) again,
 * sorry to bother you again, but maybe I got that wrong for a bit? I put up
 *     ```
       function my_post_statuses($statuses) {
           $types[] = 'pending';
           return $statuses;
       }
       add_filter('s2_post_types', 'my_post_statuses');
       ```
   
 * into my functions.php in order to have it listen to posts that are being created
   as pending from the Q&A plugin. Would that be right if the posts are being created
   in a normal fashion? It’s the standard pending status that is being applied, 
   and when I disable the pending feature for new posts, notifications go to everyone
   that subscribed to ANY of the taxonomy terms.

Viewing 15 replies - 1 through 15 (of 34 total)

1 [2](https://wordpress.org/support/topic/using-with-custom-post-type-1/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/using-with-custom-post-type-1/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/using-with-custom-post-type-1/page/2/?output_format=md)

The topic ‘Using with Custom Post Type’ is closed to new replies.

 * ![](https://ps.w.org/subscribe2/assets/icon-256x256.png?rev=2318630)
 * [Subscribe2 - Form, Email Subscribers & Newsletters](https://wordpress.org/plugins/subscribe2/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/subscribe2/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/subscribe2/)
 * [Active Topics](https://wordpress.org/support/plugin/subscribe2/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/subscribe2/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/subscribe2/reviews/)

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [email](https://wordpress.org/support/topic-tag/email/)

 * 34 replies
 * 5 participants
 * Last reply from: [Matt Robinson](https://wordpress.org/support/users/mattyrob/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/using-with-custom-post-type-1/page/3/#post-6004776)
 * Status: not resolved