• Resolved LS

    (@lsterling03)


    Hello. I’ve enabled a custom post type for Subscribe2 and have a few questions:

    1. Is there a way to disable the “post” post type? I only want to use Subscribe2 for my custom post type, not blog posts.

    2. Also, will all my existing registered users receive email notifications of new posts? I only want the public subscribers to receive emails. I have an existing set of subscriber-role users, who are subscribed to our site for different reasons. I don’t want them to receive email notifications for posts because they didn’t sign up for that. But they are listed under “Registered Subscribers” in the Subscribe2 subscriber settings. I made sure that none of the categories are selected, but I’m scared to publish a post in case it will send it to them too.

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • @lsterling03

    1. Yes there is. Subscribe2 creates an array of post types that contains ‘post’ and also ‘page’ if so configured in the Settings. When you added your post type you appended your post type slug to that array. In order to only send for your custom post type, return an array containing only your custom post type slug – i.e. remove ‘post’ and ‘page’.

    function my_post_types() {
        $types = array( 'my_post_type' );
        return $types;
    }

    2. After doing the above correction you’ll need to see if any of your sites Registered Users are Subscribers in the Subscribe2 > Subscribers page and under the Registered Users tab. They may have signed up themselves but you can unsubscribe them all from there if desired.

    Thread Starter LS

    (@lsterling03)

    Thanks @mattyrob.

    Your code looks like the code I used to add my post type, with the only difference being that you enclosed the post type in array(). Is that all that is needed to replace “post” as opposed to simply ADDING my post type in addition to post?

    Thanks!

    Thread Starter LS

    (@lsterling03)

    Here is my original code, which adds support for my post type:

    function subscribe2_my_post_types($types) {
    $types[] = ‘seminar’;
    return $types;
    }
    add_filter(‘s2_post_types’, ‘subscribe2_my_post_types’);

    Is that different than what you’ve shared? The above still works for “post” post type, even though I haven’t included it.

    Thread Starter LS

    (@lsterling03)

    Nevermind — I answered my own question. Using $types = array( 'seminar' ); instead of $types[] = 'seminar'; did indeed remove “posts” from Subscribe2. Thanks!

    @lsterling03

    $types = array( 'seminar' ); is an array with a single value of ‘seminar’.

    $types[] = 'seminar'; adds the ‘seminar’ value to an existing array.

    That’s the key difference.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Subscribe to custom post type ONLY?’ is closed to new replies.