madebyvital

Add capabilities to WordPress Editor role users

Jun 24th, 2021
646
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Add capabilities to Editor users.
  3.  */
  4. add_action('admin_init', function() {
  5.     $role = get_role('editor');
  6.     $role->add_cap('gform_full_access');  // Gravity Forms
  7.     $role->add_cap('edit_theme_options'); // Menus
  8. });
  9.  
RAW Paste Data