Edwin Harly
Edwin Harly

Reputation: 439

How to hide 'Submit for Review' button for a specific role in Wordpress?

Currently, I've got 2 roles which are Contributor and Editor, both of these roles are able to submit for review, but I only want Editor has this button and hide it for Contributor.

Upvotes: 0

Views: 542

Answers (1)

Lachie Mckelvie
Lachie Mckelvie

Reputation: 64

To hide it for a specific role you can wrap it in an if condition using current_user_can()

<?php if( current_user_can('editor') ) {  ?> 
    // code here for the editor
<?php } ?>

Upvotes: 1

Related Questions