additional_capabilities_display хук-фильтрWP 2.8.0

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.

Использование

add_filter( 'additional_capabilities_display', 'wp_kama_additional_capabilities_display_filter', 10, 2 );

/**
 * Function for `additional_capabilities_display` filter-hook.
 * 
 * @param bool    $enable       Whether to display the capabilities.
 * @param WP_User $profile_user The current WP_User object.
 *
 * @return bool
 */
function wp_kama_additional_capabilities_display_filter( $enable, $profile_user ){

	// filter...
	return $enable;
}
$enable(true|false)
Whether to display the capabilities.
По умолчанию: true
$profile_user(WP_User)
The current WP_User object.

Список изменений

С версии 2.8.0 Введена.

Где вызывается хук

В файле: /wp-admin/user-edit.php
additional_capabilities_display
wp-admin/user-edit.php 864
$display_additional_caps = apply_filters( 'additional_capabilities_display', true, $profile_user );

Где используется хук в WordPress

Использование не найдено.