WordPress.org

Ready to get started?Download WordPress

Forums

Subscribe2
[resolved] Custom post type not mailing (8 posts)

  1. cw17s0n
    Member
    Posted 1 year ago #

    My regular posts show up in the digest email, my cpt does not. Any ideas? In my functions.php I have added the following:

    function my_post_types($types) {
        $types[] = 'super_user_update';
        return $types;
    }
    
    add_filter('s2_post_types', 'my_post_types');

    and my cpt

    function register_cpt_super_user_update() {
    
        $labels = array(
            'name' => _x( 'Super User Updates', 'super_user_update' ),
            'singular_name' => _x( 'Super User Update', 'super_user_update' ),
            'add_new' => _x( 'Add New', 'super_user_update' ),
            'add_new_item' => _x( 'Add New Super User Update', 'super_user_update' ),
            'edit_item' => _x( 'Edit Super User Update', 'super_user_update' ),
            'new_item' => _x( 'New Super User Update', 'super_user_update' ),
            'view_item' => _x( 'View Super User Update', 'super_user_update' ),
            'search_items' => _x( 'Search Super User Updates', 'super_user_update' ),
            'not_found' => _x( 'No super user updates found', 'super_user_update' ),
            'not_found_in_trash' => _x( 'No super user updates found in Trash', 'super_user_update' ),
            'parent_item_colon' => _x( 'Parent Super User Update:', 'super_user_update' ),
            'menu_name' => _x( 'Super User Updates', 'super_user_update' ),
        );
    
        $args = array(
            'labels' => $labels,
            'hierarchical' => false,
            'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes' ),
            'taxonomies' => array( 'tminus', 'deployments', 'super_user_tags', 'category' ),
            'public' => true,
            'show_ui' => true,
            'show_in_menu' => true,
            'menu_position' => 5,
            'show_in_nav_menus' => false,
            'publicly_queryable' => true,
            'exclude_from_search' => false,
            'has_archive' => true,
            'query_var' => true,
            'can_export' => true,
            'rewrite' => true,
            'capability_type' => 'post'
        );
        register_post_type( 'super_user_update', $args );
    }

    http://wordpress.org/extend/plugins/subscribe2/

  2. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @cw17s0n,

    I suspect you may need to resister some custom taxonomies as well as registering the custom post type. The code for doing this is very similar to the registration of custom post types and is covered in the FAQs.

  3. cw17s0n
    Member
    Posted 1 year ago #

    I registered all of my custom taxonomies with no change, I did happen upon something, if I create a new post(standard) and a new post(custom), and trigger a digest email with crontrol, I get an email only showing the standard post, if I hit "resend digest" within subscribe2 I get the email with both posts.

  4. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @cw17s0n,

    Manually triggering digests can sometimes have unexpected consequences as it changes the database time settings for when previous events were sent. Let the next scheduled event run as planned and then make some new entries and I think based on what you are saying it should now work.

  5. cw17s0n
    Member
    Posted 1 year ago #

    I set it to hourly triggers, it has run three times now, each time it ran I create new posts, each time I get just the standard wordpress posts but not the cust. posts. Any further ideas?

  6. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @cw17s0n,

    Does it still work for a resend? If so that's very strange as the resend code runs exactly the same Subscribe2 function but just calls an SQL query with different time parameters.

  7. cw17s0n
    Member
    Posted 1 year ago #

    That is correct, it works as expected for the resend.

  8. mattyrob
    Member
    Plugin Contributor

    Posted 1 year ago #

    @cw17s0n,

    Here's how the time frames work in the code. Image 3 time points - now, 'x' in the past and '2x' in the past.

    The cron fired digest gets called by wp-cron and collects all posts made between time now and 'x'. If you manually hit resend it simply collects the posts made between 'x' and '2x'.

    The only thing I can image it might be is something to do with the times on your server. Try reseting to per-post and revery back to hourly again. You could also try the development version of the code.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic