themeblvd / jumpstart

The most extensive WordPress theme for both users and developers from Theme Blvd
http://wpjumpstart.com
GNU General Public License v2.0
5 stars 2 forks source link

Adjust default capabilities for admin pages #401

Open themeblvd opened 6 years ago

themeblvd commented 6 years ago

Have a look at this bit of code in helper-options.php, and re-evaluate the default capabilities for each admin page.

Make sure to update article: http://dev.themeblvd.com/tutorial/changing-user-role-access-for-admin-modules/

/**
 * Filters the admin page user capabilities.
 *
 * @link https://codex.wordpress.org/Roles_and_Capabilities
 *
 * @since @@name-framework 2.1.0
 *
 * @param array {
 *     Admin page with capabilities.
 *
 *     @type string $builder  Capability for displaying "Templates" page.
 *     @type string $options  Capability for displaying "Theme Options" page.
 *     @type string $sidebars Capability for displaying "Widget Areas" page.
 *     @type string $updates  Capability for displaying "Theme Updates" or "Theme License" page.
 * }
 */
$page_caps = apply_filters( 'themeblvd_admin_module_caps', array(
    'builder'  => 'edit_theme_options', // Role: Administrator
    'options'  => 'edit_theme_options', // Role: Administrator
    'sidebars' => 'edit_theme_options', // Role: Administrator
    'updates'  => 'edit_theme_options', // Role: Administrator
    'bases'    => 'edit_theme_options', // Role: Administrator
) );