Add editor user capability to manage all the Newspaper theme settings

Posted in: Newspaper
Post count: 5

Hi,
I would like to give an editor user all the capabilities to modify the settings of the newspaper theme (basically everything you can do with theme panel) but theme panel is available only to admins in a default environment. How can I give this capability to an editor? I tried with this code in functions.php but without success

// get the the role object
$editor = get_role(‘editor’);
// add $cap capability to this role object
$editor->add_cap(‘edit_theme’);
$editor->add_cap(‘edit_theme_options’);
$editor->add_cap( ‘manage_options’ );
$editor->add_cap( ‘activate_plugins’ );

thanks in advance

  • This topic was modified 9 years by nibbiolo. Reason: some basic mistakes
Post count: 20688

Hi,

In order to modify a user’s permissions you will have to edit the theme files and change the code. The theme uses the default user role capabilities of wordpress – https://codex.wordpress.org/Roles_and_Capabilities
Here is an example of how the user roles are used in our theme based on this function – https://codex.wordpress.org/Function_Reference/current_user_canhttps://www.screencast.com/t/IgcSMCC4mPF
So if you would like to have admin privileges for your editors you could make your modification there based on the editor capability. Or maybe find a plugin with that capability that you can use in this case.

Thanks

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.