added capabilities to user editor

This commit is contained in:
jorge 2024-03-12 14:48:43 +01:00
parent 032308252b
commit 29849849ef
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
<?php
/**
* Modify user roles capabilities
*
* Docs: https://wordpress.org/documentation/article/roles-and-capabilities/
*
* @package EGV-Guies
* @since EGV-Guies 1.0.0
*/
// https://wordpress.stackexchange.com/questions/4191/allow-editors-to-edit-menus
// add editor the privilege to edit theme
// get the the role object
$role_object = get_role( 'editor' );
// add $cap capability to this role object
// add edit theme
$role_object->add_cap( 'edit_theme_options' );
// add export CF7 DB
$role_object->add_cap( 'cfdb7_access' );