Created
March 25, 2016 01:09
-
-
Save garvs/e2dd30413c99fe0f5b00 to your computer and use it in GitHub Desktop.
Block permalink edit button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Hide permalink 'Edit' button for 'author' role | |
*/ | |
add_action('edit_form_before_permalink', 'ure_block_edit_slug'); | |
function ure_block_edit_slug() { | |
if (!current_user_can('author')) { | |
return; | |
} | |
wp_enqueue_script('jquery'); | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
jQuery('.edit-slug').hide(); | |
}); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code is linked to
https://www.role-editor.com/block-permalink-edit-button/