{
$roles = get_editable_roles();
foreach ($GLOBALS['wp_roles']->role_objects as $key => $role) {
- if (isset($roles[$key]) && $role->has_cap(BUILT_IN_CAPABILITY)) {
- $role->add_cap(GLM_NEW_CAPABILITY);
+ if (isset($roles[$key]) && $role->has_cap(GLM_SIMPLEMESSAGEBOARD_BUILT_IN_CAPABILITY)) {
+ $role->add_cap(GLM_SIMPLEMESSAGEBOARD_NEW_CAPABILITY);
}
}
}
{
$roles = get_editable_roles();
foreach ($GLOBALS['wp_roles']->role_objects as $key => $role) {
- if (isset($roles[$key]) && $role->has_cap(GLM_NEW_CAPABILITY)) {
- $role->remove_cap(GLM_NEW_CAPABILITY);
+ if (isset($roles[$key]) && $role->has_cap(GLM_SIMPLEMESSAGEBOARD_NEW_CAPABILITY)) {
+ $role->remove_cap(GLM_SIMPLEMESSAGEBOARD_NEW_CAPABILITY);
}
}
}
add_menu_page(
'Gaslight Simple Messageboard',
'GLM Simple Messageboard',
- GLM_NEW_CAPABILITY,
+ GLM_SIMPLEMESSAGEBOARD_NEW_CAPABILITY,
'glmsimplemessageboard',
array($this, 'glmsimplemessageboard_options_page'),
'dashicons-id'
public function glmsimplemessageboard_option_page_capability($capability)
{
- return GLM_NEW_CAPABILITY;
+ return GLM_SIMPLEMESSAGEBOARD_NEW_CAPABILITY;
}
public function glmsimplemessageboard_options_page()
{
- if (current_user_can(GLM_NEW_CAPABILITY)) {
+ if (current_user_can(GLM_SIMPLEMESSAGEBOARD_NEW_CAPABILITY)) {
include $this->path . 'views/optionsPage.php';
} else {
include $this->path . 'views/deniedAccess.php';
/**
* Plugin Name: GLM Simple Messageboard
* Description: Option Setting for displaying two fields; a name and a message
- * Version: 1.0.6
+ * Version: 1.0.7
* Author: Gaslight Media
* Author URI: http://www.gaslightmedia.com
* License: All right reserved
*/
define('GLM_SIMPLEMESSAGEBOARD_SETTINGS', 'glmsimplemessageboard_settings');
-define('GLM_NEW_CAPABILITY', 'glmsimplemessageboard_edit_messageboard');
-define('BUILT_IN_CAPABILITY', 'edit_posts');
+define('GLM_SIMPLEMESSAGEBOARD_NEW_CAPABILITY', 'glmsimplemessageboard_edit_messageboard');
+define('GLM_SIMPLEMESSAGEBOARD_GLM_SIMPLEMESSAGEBOARD_BUILT_IN_CAPABILITY', 'edit_posts');
register_activation_hook(__FILE__, array('Glmsimplemessageboard_Admin_Controller', 'activate_plugin'));
register_deactivation_hook(__FILE__, array('Glmsimplemessageboard_Admin_Controller', 'deactivate_plugin'));