Monday, July 18, 2022
HomeWordPress Developmentblock editor - Take away capability to edit posts for all customers...

block editor – Take away capability to edit posts for all customers besides admins


So I’ve been eager to determine this out for a while now and I can not seem to work it out, however I wish to have a whole put up edit restriction for posts.

So I’ve the next code:

public operate remove_edit_permissions($actions = [])
{
    if (isset($actions['inline hide-if-no-js'])) {
        unset($actions['inline hide-if-no-js']);
    }
    if (isset($actions['edit'])) {
        unset($actions['edit']);
    }

    return $actions;
}
add_filter('post_row_actions', [$this, 'remove_edit_permissions'], 10, 2 );

Which eliminated the “Edit” and “Fast Edit” buttons within the admin UI:
enter image description here

Does anybody know the way I may also limit entry to edit utilizing the hyperlink?

Instance: https://instance.com/wp-admin/put up.php?put up=9851&motion=edit

All assist will probably be appreciated!

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments