Forcing two or more custom post type to be private
I registered a new custom post type and forced it to be private, but now I need to use three custom post type. I registered the second one, but I don't know hot to set the code to force the second one.
Here is the code I used to force the first CPT ('my_post_type1')
function force_type_private($post)
{
if ($post['post_type'] == 'my_post_type1') {
$post['post_status'] = 'private';
}
return $post;
}
add_filter('wp_insert_post_data', 'force_type_private');
How can I force the second ('my_post_type2')?
Thank you very much
Topic private custom-post-types Wordpress
Category Web