Advertisement
brasofilo

Private by default

Aug 17th, 2013
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2. /**
  3.  Plugin Name: Private by Default
  4.  */
  5.  
  6. add_action( 'post_submitbox_misc_actions' , 'b5f_default_post_visibility' );
  7.  
  8. function b5f_default_post_visibility(){
  9.     global $pagenow;
  10.     if( 'post-new.php' != $pagenow )
  11.         return;
  12. ?>
  13. <script type="text/javascript">
  14. jQuery(document).ready(function($) {  
  15.     $('#post-visibility-display').text('Private');
  16.     $('#hidden-post-visibility').val('private');
  17.     $('#visibility-radio-private').attr('checked', true);
  18. });
  19. </script>
  20. <?php
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement