brasofilo

Private by default

Aug 17th, 2013
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data