Enable support for non-public Custom Post Type

By default, you can select only public post types in the Notification settings. To add a support for non-public post type you need to add it via a filter:

add_filter( 'notification/settings/triggers/valid_post_types', function( $post_types ) {

	// Slug is the key and Singular name is the value.
	$post_types['non_public_post_type_slug'] = __( 'Non Public Post Type' );

	return $post_types;

}, 10, 2 );

Not all Merge Tags will be working properly for the private post type, ie. the permalink tag.

Last updated