0

I want to remove the entire section that says Save Draft, Preview and Status: Draft and Visibility: Public.

I want to not show it. Its ok if it is still fuctional.

Attached is the part I do not want to display.

Can someone show me how to do it?

Here is the area I want to not display:

http://kind.s3.amazonaws.com/removethissection.jpg

1

You can hide them using CSS. Add this to the theme's functions.php file, or add a plug-in header to the top of the file and zip it up to use as a plug-in:

<?php
  add_action('admin_print_styles', 'remove_this_stuff');
  function remove_this_stuff() {
  ?>
<style>
  #misc-publishing-actions, #minor-publishing-actions {
  display:none;
  }
</style>
<?php } ?>
  • Thank you! But I can't get it to work.. Also the contact form on your site doesn't work because I tried to email you. Please write back. – LucidDayDream Feb 7 '12 at 21:17
  • I fixed the contact form, thanks for the heads up. – Jeremy Jared Feb 7 '12 at 21:26
0

The above solution doesn't work (returns error 500), but this one does:

add_action('admin_head', 'leave_only_publish_button');

function leave_only_publish_button() {
    if( !current_user_can('activate_plugins') ) { //doesn't affect users who can activate plugins, remove if needed
        echo '<style>
            #misc-publishing-actions, #minor-publishing-actions {
            display:none;
        }
    </style>';
    }
}
  • 1
    The code here seems to be valid PHP, but one has to be careful when doing copy/paste into functions.php regarding the opening <?php and closing ?>. – birgire Mar 11 '16 at 10:07
  • The problem isn't in the opening and closing PHP tags for the code you linked. – Chris Trynkiewicz Mar 12 '16 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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