What’s wrong with “customize” capability ?
-
Hi,
I am creating an intranet for my company and I needed to grant the customize capability to the Editor role. Not a big expert in custom development on WordPress, I added this to the functions.php of my custom theme.
/** * Grants new capabilities to some roles during theme activation * Revoke the same capabilities upon theme deactivation * * @var WP_Role $role_object */ add_action('after_switch_theme', function() { $role_object = get_role( 'editor' ); $role_object->add_cap('customize'); }); add_action('switch_theme', function() { $role_object = get_role( 'editor' ); $role_object->remove_cap('customize'); });Looked good for me but after I reactivated my theme, nothing changed. My editors hadn’t have access to the customize menu.
I tried then with the capability edit_theme_options. It worked, but I don’t want all those options available.Did I do something wrong ? Does the customize capability require another one ?
Here is the context :
Plugins- Force Login
- Slack Notifications
- User Access Manager
- Wordfence
The Theme is a child of TwentySeventeen
The topic ‘What’s wrong with “customize” capability ?’ is closed to new replies.
