The members members get hidden caps function.
Published Date - July 31, 2023
Return an array of capabilities that are not allowed on this installation.
members_get_hidden_caps();
The following example is for adding a hook callback.
if ( !function_exists( 'members_get_hidden_caps' ) ) {
require_once ABSPATH . PLUGINDIR . 'membersmembers/inc/functions-capabilities.php';
}
// NOTICE! Understand what this does before running.
$result = members_get_hidden_caps();
The function is defined in the following location(s).
members/inc/functions-capabilities.php
function members_get_hidden_caps() {
$caps = array();
// This is always a hidden cap and should never be added to the caps list.
$caps[] = 'do_not_allow';
// Network-level caps.
// These shouldn't show on single-site installs anyway.
// On multisite installs, they should be handled by a network-specific role manager.
$caps[] = 'create_sites';
$caps[] = 'delete_sites';
$caps[] = 'manage_network';
$caps[] = 'manage_sites';
$caps[] = 'manage_network_users';
$caps[] = 'manage_network_plugins';
$caps[] = 'manage_network_themes';
$caps[] = 'manage_network_options';
$caps[] = 'upgrade_network';
// This cap is needed on single site to set up a multisite network.
if ( is_multisite() )
$caps[] = 'setup_network';
// Unfiltered uploads.
if ( is_multisite() || ! defined( 'ALLOW_UNFILTERED_UPLOADS' ) || ! ALLOW_UNFILTERED_UPLOADS )
$caps[] = 'unfiltered_upload';
// Unfiltered HTML.
if ( is_multisite() || ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML ) )
$caps[] = 'unfiltered_html';
// File editing.
if ( is_multisite() || ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ) ) {
$caps[] = 'edit_files';
$caps[] = 'edit_plugins';
$caps[] = 'edit_themes';
}
// File mods.
if ( is_multisite() || ( defined( 'DISALLOW_FILE_MODS' ) && DISALLOW_FILE_MODS ) ) {
$caps[] = 'edit_files';
$caps[] = 'edit_plugins';
$caps[] = 'edit_themes';
$caps[] = 'update_plugins';
$caps[] = 'delete_plugins';
$caps[] = 'install_plugins';
$caps[] = 'upload_plugins';
$caps[] = 'update_themes';
$caps[] = 'delete_themes';
$caps[] = 'install_themes';
$caps[] = 'upload_themes';
$caps[] = 'update_core';
}
return array_unique( $caps );
}