Skip to content

Commit 1a5cd6e

Browse files
authored
Merge pull request #2 from rumspeed/fix-theme-options-permissions
Fix theme options permissions
2 parents b8d30f9 + a5dfa0c commit 1a5cd6e

2 files changed

Lines changed: 27 additions & 6 deletions

File tree

includes/modify-caps.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ function rum_modify_theme_blvd_module_caps( $module_caps ) {
1818
$module_caps['sliders'] = 'edit_pages';
1919

2020
// Theme Options
21-
// TODO - further research required; Theme Options is displayed but doesn't save; "Cheatin’ uh?"
22-
// $module_caps['options'] = 'edit_pages';
21+
$module_caps['options'] = 'edit_pages';
2322

2423
// Widget Area Manager
2524
// TODO - further research required; sidebars area not display in Editor menu

modify-theme-blvd-plugin-capabilities.php

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
/*
33
Plugin Name: Modify Theme Blvd Plugin Capabilities
44
Description: Modify capabilities to allow Editors access to Theme Blvd plugins
5-
Version: 0.3.1
5+
Version: 0.3.2
66
Author: Scot Rumery
7-
Author URI: http://rumspeed.com/scot-rumery/
7+
Author URI: http://rumspeed.com
88
License: GPLv2
99
*/
1010

11-
/* Copyright 2013 Scot Rumery (email : scot@rumspeed.com)
11+
/* Copyright 2023 Scot Rumery (email : scot@rumspeed.com)
1212
1313
This program is free software; you can redistribute it and/or modify
1414
it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@
2929

3030

3131

32-
define( 'RUM_MODIFY_CAPS_PLUGIN_VERSION', '0.3.1' );
32+
define( 'RUM_MODIFY_CAPS_PLUGIN_VERSION', '0.3.2' );
3333
define( 'RUM_MODIFY_CAPS_PLUGIN_DIR', dirname( __FILE__ ) );
3434
define( 'RUM_MODIFY_CAPS_PLUGIN_URI', plugins_url( '' , __FILE__ ) );
3535

@@ -39,3 +39,25 @@
3939
// include files - these are simply to organize functions into logical areas
4040
include_once( 'includes/modify-caps.php' );
4141

42+
43+
44+
45+
register_activation_hook( __FILE__, 'mtbpc_plugin_activated' );
46+
register_deactivation_hook( __FILE__, 'mtbpc_plugin_deactivated' );
47+
48+
49+
50+
51+
function mtbpc_plugin_activated() {
52+
$role = get_role( 'editor' );
53+
$role->add_cap( 'manage_options' );
54+
}
55+
56+
57+
58+
59+
function mtbpc_plugin_deactivated() {
60+
$role = get_role( 'editor' );
61+
$role->remove_cap( 'manage_options' );
62+
}
63+

0 commit comments

Comments
 (0)