Change role access to Menus and Widgets


/ Published in: PHP
Save to your folder(s)

Instructions:

WordPress menus and sidebars/widgets are really powerful modules, but unfortunately it requires Admin user role to edit them.

If you would like to allow users with Editor user role to edit any of the widgets or menus, just paste the code below into your themes functions.php file.


Copy this code and paste it in your HTML
  1. <?php
  2. // get the the role object
  3. $role_object = get_role('editor');
  4. // add $cap capability to this role object
  5. $role_object->add_cap('edit_theme_options');
  6. ?>

URL: http://wp-snippets.com/change-role-access-to-menus-and-widgets/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.