Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
142 views
in Technique[技术] by (71.8m points)

php - the role i created for wordpress doesn't show my plugin

I have created a custom role for wordpress, but I don't know a method to give it permissions to access my plugin section.

what do you mean ? In the sense that even adding all the possible permissions, the menu of my plugin is not visible and therefore it is not possible to access the settings


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The following snippet will allow you to add a custom role called "Plugin Manager" with permission to manage plugins.

 add_role(
        'plugin-manager',
        'Plugin Manager',
        [
            'activate_plugins',
            'update_plugins',
            'install_plugins',
            'delete_plugins',
            'edit_plugins',
            'upload_plugins'
        ]
 );

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...