From 9969ca448a1b1fdb86117bf85c4a9309e701d8b8 Mon Sep 17 00:00:00 2001 From: Scot Rumery Date: Fri, 31 Mar 2023 20:08:34 -0400 Subject: [PATCH 1/2] Update modify-caps.php --- includes/modify-caps.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/modify-caps.php b/includes/modify-caps.php index cef61b0..0395570 100644 --- a/includes/modify-caps.php +++ b/includes/modify-caps.php @@ -18,8 +18,7 @@ function rum_modify_theme_blvd_module_caps( $module_caps ) { $module_caps['sliders'] = 'edit_pages'; // Theme Options -// TODO - further research required; Theme Options is displayed but doesn't save; "Cheatin’ uh?" -// $module_caps['options'] = 'edit_pages'; + $module_caps['options'] = 'edit_pages'; // Widget Area Manager // TODO - further research required; sidebars area not display in Editor menu From a5dfa0cf9bd0a0aa04895dcc595809cd76b0ce42 Mon Sep 17 00:00:00 2001 From: Scot Rumery Date: Fri, 31 Mar 2023 20:08:57 -0400 Subject: [PATCH 2/2] Update modify-theme-blvd-plugin-capabilities.php --- modify-theme-blvd-plugin-capabilities.php | 30 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/modify-theme-blvd-plugin-capabilities.php b/modify-theme-blvd-plugin-capabilities.php index c534e83..8a6641e 100644 --- a/modify-theme-blvd-plugin-capabilities.php +++ b/modify-theme-blvd-plugin-capabilities.php @@ -2,13 +2,13 @@ /* Plugin Name: Modify Theme Blvd Plugin Capabilities Description: Modify capabilities to allow Editors access to Theme Blvd plugins -Version: 0.3.1 +Version: 0.3.2 Author: Scot Rumery -Author URI: http://rumspeed.com/scot-rumery/ +Author URI: http://rumspeed.com License: GPLv2 */ -/* Copyright 2013 Scot Rumery (email : scot@rumspeed.com) +/* Copyright 2023 Scot Rumery (email : scot@rumspeed.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ -define( 'RUM_MODIFY_CAPS_PLUGIN_VERSION', '0.3.1' ); +define( 'RUM_MODIFY_CAPS_PLUGIN_VERSION', '0.3.2' ); define( 'RUM_MODIFY_CAPS_PLUGIN_DIR', dirname( __FILE__ ) ); define( 'RUM_MODIFY_CAPS_PLUGIN_URI', plugins_url( '' , __FILE__ ) ); @@ -39,3 +39,25 @@ // include files - these are simply to organize functions into logical areas include_once( 'includes/modify-caps.php' ); + + + +register_activation_hook( __FILE__, 'mtbpc_plugin_activated' ); +register_deactivation_hook( __FILE__, 'mtbpc_plugin_deactivated' ); + + + + +function mtbpc_plugin_activated() { + $role = get_role( 'editor' ); + $role->add_cap( 'manage_options' ); +} + + + + +function mtbpc_plugin_deactivated() { + $role = get_role( 'editor' ); + $role->remove_cap( 'manage_options' ); +} +