Support » Plugin: Subscribe2 » Subscribe2 & Custom Post Types (More Types)

  • I am trying to get Subscribe2 to send out updates for my custom post type. I have read the page here…

    Subscribe2 and Custom Post Types

    The plugin I am using for custom post types is More Types to manage custom post types. My issue is I don’t know where to put the recommended code…

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

    to make the custom post types work. Has anyone integrated More Types with the code above?

    Cheers.

Viewing 7 replies - 1 through 7 (of 7 total)
  • @husar,

    You need to put this code into a custom plugin for your site or into the functions.php file of your theme.

    I don’t use More Types so I don’t know anything about it but I guess there must be a way to collect all of the post type slug names and then cycle through them adding them to the $types[] array. Something like:

    $custom_types = $more_types->get_types_function();
    foreach( $custom_type as type ) {
    	$types[] = $type;
    }

    @husar,

    I had a little time to spare so looked through the More Types code. This is untested but I think it will work.

    global $more_types;
    
    $pages = $more_types->get_objects(array('_plugin_saved', '_plugin'));
    
    foreach((array) $pages as $name => $page) {
    	$types[] = $name;
    }

    @mattyrob

    What file in the More Types were you looking at. There are size files in that plugin. I have tried a few but not having any luck yet.

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

    Adding that to my functions.php seems to work now. But that only limits me to one custom post type.

    @husar,

    Add extra $types[] = ''; lines for each custom type until you have one for each of you custom post types.

    Hi

    Please,

    I’ve added this code to my theme’s functions.php file but it doesn’t seem to work : no mesages sent and no toggle appears in my custom post detail page in the admin…

    Must I modify that code before inserting it ?

    Thanks

    Hi, I use GD Taxonomies Tools (http://wordpress.org/extend/plugins/gd-taxonomies-tools/) to register/manage custom posts types and tried the code posted in this thread in functions.php

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

    Unfortunately, it didn’t work (I contacted GD’s author and he recommended I ask over here).

    Is there possibly a differently way of setting up the functions call so it’ll work with GD tools?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Subscribe2 & Custom Post Types (More Types)’ is closed to new replies.