Compare commits
2 commits
1973989d36
...
fdd6a154ad
Author | SHA1 | Date | |
---|---|---|---|
|
fdd6a154ad | ||
|
5d935209c4 |
|
@ -56,7 +56,8 @@ include( ARCHIVE_WPPLUGIN_PATH . 'includes/arcHIVE-init-textdomain.php');
|
||||||
|
|
||||||
include( ARCHIVE_WPPLUGIN_PATH . 'includes/arcHIVE-enable-svg.php');
|
include( ARCHIVE_WPPLUGIN_PATH . 'includes/arcHIVE-enable-svg.php');
|
||||||
|
|
||||||
include_once( ARCHIVE_WPPLUGIN_PATH . 'includes/arcHIVE-add-roles.php');
|
// disabled for now
|
||||||
|
// include_once( ARCHIVE_WPPLUGIN_PATH . 'includes/arcHIVE-add-roles.php');
|
||||||
|
|
||||||
if ( is_admin() ) {
|
if ( is_admin() ) {
|
||||||
//include_once( plugin_dir_path( __FILE__ ) . 'includes/arcHIVE-admin-stylesheet.php' );
|
//include_once( plugin_dir_path( __FILE__ ) . 'includes/arcHIVE-admin-stylesheet.php' );
|
||||||
|
|
59
includes/arcHIVE-delete-capabilities.php
Normal file
59
includes/arcHIVE-delete-capabilities.php
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Delete capabilities created in development and in plugin removal.
|
||||||
|
*
|
||||||
|
* @link https://arc-hive.zone
|
||||||
|
* @since 1.1.0
|
||||||
|
*
|
||||||
|
* @package archive_wpplugin
|
||||||
|
* @subpackage archive_wpplugin/includes
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete capabilities created in development and in plugin removal.
|
||||||
|
*
|
||||||
|
* This class defines all code necessary to run during the plugin's activation.
|
||||||
|
*
|
||||||
|
* @since 1.1.0
|
||||||
|
* @package archive_wpplugin
|
||||||
|
* @subpackage archive_wpplugin/includes
|
||||||
|
* @author Jorge - vitrubio.net <jorge@vitrubio.net>
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Function to delete capabilities
|
||||||
|
// Based on http://chrisburbridge.com/delete-unwanted-wordpress-custom-capabilities/
|
||||||
|
function clean_unwanted_caps() {
|
||||||
|
global $wp_roles;
|
||||||
|
$delete_caps = array(
|
||||||
|
'read_archive_resource',
|
||||||
|
'publish_archive_resources',
|
||||||
|
'edit_archive_resources',
|
||||||
|
'edit_archive_published_resources',
|
||||||
|
'edit_other_archive_resources',
|
||||||
|
'delete_archive_resources',
|
||||||
|
'delete_archive_published_resources',
|
||||||
|
'delete_archive_others_resources',
|
||||||
|
'delete_archive_private_resources',
|
||||||
|
'upload_media_files',
|
||||||
|
'manage_archive_resources_types',
|
||||||
|
'archive_read_resource',
|
||||||
|
'archive_publish_resources',
|
||||||
|
'archive_edit_resources',
|
||||||
|
'archive_edit_published_resources',
|
||||||
|
'archive_edit_other_resources',
|
||||||
|
'archive_delete_resources',
|
||||||
|
'archive_delete_published_resources',
|
||||||
|
'archive_delete_others_resources',
|
||||||
|
'archive_delete_private_resources',
|
||||||
|
'archive_upload_media_files',
|
||||||
|
'archive_manage_resources_types',
|
||||||
|
'archive_manage_resources_types'
|
||||||
|
);
|
||||||
|
foreach ($delete_caps as $cap) {
|
||||||
|
foreach (array_keys($wp_roles->roles) as $role) {
|
||||||
|
$wp_roles->remove_cap($role, $cap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_action( 'admin_init', 'clean_unwanted_caps' );
|
||||||
|
// register_activation_hook( __FILE__, 'archive_wpplugin_add_roles_on_plugin_activation' );
|
Loading…
Reference in a new issue