CPT in Private
-
Hello,
I use your plugin for 2 different CPT. Actually all posts should be stay in private status. I have found a code thats working well for 1 CPT, but i do not find the right way to do it for 2 CPT.
Here is the code i used for the first CPT and its posts to let it private everytime :
function force_type_private($post) { if ($post['post_type'] != 'my_custom_cpt' || $post['post_status'] == 'trash') return $post; $post['post_status'] = 'private'; return $post; } add_filter('wp_insert_post_data', 'force_type_private');
Do you know how to add the second CPT to make it works for the both CPT ?
Thanks a lot in advance
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘CPT in Private’ is closed to new replies.