Filter hook 'additional_capabilities_display'

in WP Core File wp-admin/user-edit.php at line 910

View Source

additional_capabilities_display

Filter Hook
Description
Filters whether to display additional capabilities for the user. The 'Additional Capabilities' section will only be enabled if the number of the user's capabilities exceeds their number of roles.

Hook Information

File Location wp-admin/user-edit.php View on GitHub
Hook Type Filter
Line Number 910

Hook Parameters

Type Name Description
bool $enable Whether to display the capabilities. Default true.
WP_User $profile_user The current WP_User object.

Usage Examples

Basic Usage
<?php
// Hook into additional_capabilities_display
add_filter('additional_capabilities_display', 'my_custom_filter', 10, 2);

function my_custom_filter($enable, $profile_user) {
    // Your custom filtering logic here
    return $enable;
}

Source Code Context

wp-admin/user-edit.php:910 - How this hook is used in WordPress core
<?php
 905  					 * @since 2.8.0
 906  					 *
 907  					 * @param bool    $enable      Whether to display the capabilities. Default true.
 908  					 * @param WP_User $profile_user The current WP_User object.
 909  					 */
 910  					$display_additional_caps = apply_filters( 'additional_capabilities_display', true, $profile_user );
 911  					?>
 912  
 913  				<?php if ( count( $profile_user->caps ) > count( $profile_user->roles ) && ( true === $display_additional_caps ) ) : ?>
 914  					<h2><?php _e( 'Additional Capabilities' ); ?></h2>
 915  

PHP Documentation

<?php
/**
					 * Filters whether to display additional capabilities for the user.
					 *
					 * The 'Additional Capabilities' section will only be enabled if
					 * the number of the user's capabilities exceeds their number of
					 * roles.
					 *
					 * @since 2.8.0
					 *
					 * @param bool    $enable      Whether to display the capabilities. Default true.
					 * @param WP_User $profile_user The current WP_User object.
					 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/user-edit.php
Related Hooks

Related hooks will be displayed here in future updates.