Created
March 22, 2013 05:19
-
-
Save spencejs/5219121 to your computer and use it in GitHub Desktop.
Force Post Type To Be Private In Wordpress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Force Post type to be Private | |
| function force_type_private($post){ | |
| if ($post['post_type'] == 'my_post_type') | |
| $post['post_status'] = 'private'; | |
| return $post; | |
| } | |
| add_filter('wp_insert_post_data', 'force_type_private'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment