xarxaprod-wp-theme/inc/user-role-capabilities-mod.php

21 lines
551 B
PHP
Raw Normal View History

2024-03-12 14:48:43 +01:00
<?php
/**
* Modify user roles capabilities
*
* Docs: https://wordpress.org/documentation/article/roles-and-capabilities/
*
* @package Xarxaprod_theme
* @since Xarxaprod_theme 1.0.0
2024-03-12 14:48:43 +01:00
*/
// 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' );