Automattic\WooCommerce\Internal\AbilitiesApi
AbilitiesClient::enable
Enable the WordPress Abilities API client for admin pages.
This is the main method external plugins should use to enable the abilities API JavaScript client.
Метод класса: AbilitiesClient{}
Хуков нет.
Возвращает
bool. True if successfully enabled, false otherwise.
Использование
$result = AbilitiesClient::enable(): bool;
Код AbilitiesClient::enable() AbilitiesClient::enable WC 11.2.2
public static function enable(): bool {
// Only enable once.
if ( self::$enabled ) {
return true;
}
// Hook into admin_enqueue_scripts to enqueue when needed.
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'enqueue_for_admin' ) );
self::$enabled = true;
return true;
}