Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

By default, the Status, Visibility, and Date fields in the Publish metabox are closed, and you have to click Edit to show them.

Is there a way to make these fields visible by default?

The hidden elements all have a class of hide-if-js.

share|improve this question
    
You can figure out their respective containers' id using any DOM inspector and set their visibility in CSS file or using jQuery. –  Max Yudin Feb 19 '13 at 20:34

2 Answers 2

This jQuery code seems to work, when added via the admin_footer hook.

  • #submitdiv = the whole Publish metabox
  • .misc-pub-section = each UI section (except the Publish and Save sections)
  • .hide-if-js = the fields that are hidden by default

    $('#submitdiv .misc-pub-section')
        .has("#post-status-display, #timestamp")
        .find('.hide-if-js')
        .toggle();
    

That will unhide the Status dropdown and the Date picker.

share|improve this answer

Building upon @supertrue 's answer, here is a full implementation.

1./ Create a .js file (for ex: admin-post-ui-visibility.js) containing the following:

(function($){

    $('#submitdiv .misc-pub-section')
        .has("#post-status-display, #timestamp")
        .find('.hide-if-js')
        .toggle();

})(jQuery);

2./ Add this to your Theme's functions.php file:

function reveal_visibility_metabox($hook){
    if( 'post.php' != $hook )
        return;
    wp_enqueue_script( 'reveal_visibility_metabox', get_stylesheet_directory_uri().'/library/js/admin-post-ui-visibility.js', array( 'jquery' ), '', true );
}
add_action( 'admin_enqueue_scripts', 'reveal_visibility_metabox' );
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.