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.

I need to remove the Edit link next to Publish immediately as I don't want my user to schedule the post. How can I achieve this? Thanks!

share|improve this question
    
What have you found in your research? –  brasofilo Feb 11 '13 at 19:13
    
Nothing! That's the reason for posting here... –  user27309 Feb 11 '13 at 22:10
    
I did not see the link... sorry :) –  user27309 Feb 17 '13 at 0:13

1 Answer 1

up vote 1 down vote accepted

Here is one idea to hide the Edit link via CSS:

function wpse85434_hide_editlinks() {
    if(!current_user_can('manage_options')){
        // only for non-admins
        echo "<style>.misc-pub-section .edit-timestamp{display:none !important;} </style>";
    }
}
add_action('admin_head-post.php','wpse85434_hide_editlinks');
add_action('admin_head-post-new.php','wpse85434_hide_editlinks');

I use !current_user_can('manage_options') so it will be visible for the admin.

Before:

Before

After:

After

share|improve this answer
1  
Make sure this only prints in the correct screen, e.g.: add_action('admin_head-post.php', 'callback');. –  brasofilo Feb 11 '13 at 21:27
    
Birgire, it works like a charm! Thanks brasofilo too! –  user27309 Feb 11 '13 at 22:09
    
ok great. Thanks brasofilo, I updated the code example with your suggestion. –  birgire Feb 11 '13 at 22:32

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.