I have been following the advice of this answer, but ran into a glitch...
The post Visibility says "Private" on my custom post, but if you click the "Edit" link to reveal the radio buttons, the "Public" button is still selected (see screen shot). So in fact my post is not private at all, even though it says that word in the visibility field (so appears to be working at first glance).
Here is what my code looks like **Edits: this was changed to show the correct code:
// Set Updates post to private by default
add_action( 'post_submitbox_misc_actions' , 'wpse118970_change_visibility_metabox' );
function wpse118970_change_visibility_metabox(){
global $post;
if ($post->post_type != 'updates')
return;
$post->post_password = '';
$visibility = 'private';
$visibility_trans = __('Private');
?>
<script type="text/javascript">
(function($){
try {
$('#post-visibility-display').text('<?php echo $visibility_trans; ?>');
$('#hidden-post-visibility').val('<?php echo $visibility; ?>');
} catch(err){}
}) (jQuery);
</script>
<?php
}
Any suggestions?
*Note: I commented out the print_r($post); because it was giving me extra text on my page that I didn't want my client looking at (see screen shot). I also removed the call to show the message, as I didn't want to draw attention to it. Guess I could have also removed that code to clean it up, but hadn't thus far.