I’ve noticed that the custom taxonomies are added to the end of the normal categories list, however I am receiving emails for all taxonomies, not just the one I’ve ticked.
Also is there a way to hide the default categories and just display the custom taxonomies?
@mileskimberley,
the ‘s2_taxonomies’ filter takes the current set of taxonomies (i.e. categories) and allows that to be added to or over ridden. You are currently adding your ‘member’ taxonomy to the array with $taxonomies[] instead you need to change that line to:
$taxonomies = array('member');
Thanks,
That cleans up the settings screen, but I am still receiving post notifications for taxonomies that I have not ticked…
@mileskimberley,
I don’t really understand what you mean, you only have 2 taxonomies, categories and members – right?
We have a member taxonomy which is used to assign a job to a Team Member, I only wish to receive an email when a new job is assigned to me.
I therefore tick the Miles box in the Subscribe2 settings, however I receive an email when any new job is added, not just the ones given the Miles member taxonomy…
@mileskimberley,
Is your account being used as the sender account and do you have the number of recipients per email set to something other than 1 in the subscribe2->Settings page under the Email Settings tab?
‘Restrict the number of recipients per email to’ is set to 1 and the ‘Send Email From’ setting is set to ‘Post Author’
@mileskimberley,
That all seems correct. I’m not sure I can suggest anything further without seeing you site.
We used Custom Post Type UI to create the custom post type and taxonomy, would that make a difference?
If there’s nothing you can suggest, is there at least a way to get the {CATS} shortcode in the template to work with the custom taxomony, so I can put the member name in the email subject?
@mileskimberley,
The Custom Post Type UI should make any difference unless the post type name is not correct.
I presume from what you are saying, the {CATS} keyword doesn’t work. That would indicated that the post type or taxonomy are not quite right though. you could try calling the core get_taxonomies() and get_post_types() functions to see what taxonomies and post types are registered and what names are being used.
get_taxonomies shows the below list:
status
member
type
get_post_types shows the below list:
job
Presumably the taxonomies would not be displayed on the settings page if there was an error there and I wouldn’t be receiving an email when new jobs are added at all if that was the issue?
The code generated for the taxonomy by CPT UI is as below:
add_action('init', 'cptui_register_my_taxes_member');
function cptui_register_my_taxes_member() {
register_taxonomy( 'member',array (
0 => 'job',
),
array( 'hierarchical' => true,
'label' => 'Team Members',
'show_ui' => true,
'query_var' => true,
'show_admin_column' => true,
'labels' => array (
'search_items' => 'Team Member',
'popular_items' => '',
'all_items' => '',
'parent_item' => '',
'parent_item_colon' => '',
'edit_item' => '',
'update_item' => '',
'add_new_item' => '',
'new_item_name' => '',
'separate_items_with_commas' => '',
'add_or_remove_items' => '',
'choose_from_most_used' => '',
)
) );
}
If that helps…
And for the jobs post type:
add_action('init', 'cptui_register_my_cpt_job');
function cptui_register_my_cpt_job() {
register_post_type('job', array(
'label' => 'Jobs',
'description' => '',
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'post',
'map_meta_cap' => true,
'hierarchical' => false,
'rewrite' => array('slug' => 'jobs', 'with_front' => 1),
'query_var' => true,
'has_archive' => true,
'menu_position' => '5',
'supports' => array('title','editor','revisions','thumbnail','author'),
'taxonomies' => array('category','status','member','type'),
'labels' => array (
'name' => 'Jobs',
'singular_name' => 'Job',
'menu_name' => 'Jobs',
'add_new' => 'Add Job',
'add_new_item' => 'Add New Job',
'edit' => 'Edit',
'edit_item' => 'Edit Job',
'new_item' => 'New Job',
'view' => 'View Job',
'view_item' => 'View Job',
'search_items' => 'Search Jobs',
'not_found' => 'No Jobs Found',
'not_found_in_trash' => 'No Jobs Found in Trash',
'parent' => 'Parent Job',
)
) ); }
@mileskimberley,
That all looks right – what are the ‘status’ and ‘type’ taxonomies? Have you created those too?
Yes, they were also created with CPT UI, status showing the status of the job – Complete, In Progress etc and Type showing the type of job – Website, Brochure etc…