diff --git a/includes/arcHIVE-delete-capabilities.php b/includes/arcHIVE-delete-capabilities.php new file mode 100644 index 0000000..292be3b --- /dev/null +++ b/includes/arcHIVE-delete-capabilities.php @@ -0,0 +1,59 @@ + + */ + +// 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' );