I am making a site which will only have password protected pages. I would like it so that the password box is open by default, and is a required fields to publish the post. Ideally I would also remove the ‘public’ and ‘private’ options.
Is this possible?
You would be better suited by allowing members to sign up on your site, then giving each uses level permissions to read different posts. A plugin like Members might work for this.
But, if you really want to do what you asked, you’re going to have to do some javascript hacking or completely remove the publish meta box and roll your own. There’s not a ton of filters in there for use, unfortunately.
To do the JS way, you’d need to enqueue your script…
… Which would probably look something like this:
To roll your own submit meta box, you can add an action to
add_meta_boxes_post
and in the hooked function, remove the current submit box, and add your own.In your
wpse38806_post_submit_meta_box
callback, you should copy the contents ofpost_submit_meta_box
, found intwp-admin/includes/meta-boxes.php
, and take out the relevant sections. It’s a very long function, so I’m not going to post the entire thing. I just removed the few bits we don’t want, and added a few style attribute to force things to be displayed.Here’s all that as a plugin.
You might be much better off using a plugin to make the blog private, as opposed to each individual post – something like Private Only?
You could do this using Javascript: