Is it possible to have the Editors to change a permalink on an unpublished post, but only admins change a permalink on a post that has ever been published?

I can hide the button for non admin but I am bit stuck here and I am not sure if this is possible, any help would be very appreciated.

function hide_slug_box(){
 global $post;
 global $pagenow;
 if ( is_admin() && ! current_user_can( 'administrator' ) && $pagenow=='post-new.php' OR $pagenow=='post.php' ) {

echo "<style>
button.edit-slug.button.button-small.hide-if-no-js { display: none !important;   }
 add_action( 'admin_head', 'hide_slug_box' );
  • please don't bump your question, if you need answer "now", just hire someone. – Mark Kaplun Feb 16 '16 at 16:01
  • @MarkKaplun sorry I am not sure what you mean with "bump" question – Nuno Sarmento Feb 16 '16 at 16:22
  • The edit you have made added no new info.... if the intention was not to bump, then you should know that as long as it is clear what the question is about you don't need to fix the syntax as most people here do not speak perfect english in any case. – Mark Kaplun Feb 16 '16 at 16:38
  • @MarkKaplun - no intention at all to bump my question. Thank you for your info I wont do it again. – Nuno Sarmento Feb 16 '16 at 17:26

Your Answer

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

Browse other questions tagged or ask your own question.