Automattic\WooCommerce\Internal\Abilities
AbilitiesTracking::is_tracking_allowed
Whether the current site allows usage tracking.
Unlike WC_Site_Tracking::is_tracking_enabled() alone, this requires the stored opt-in: that method also treats a posted wc_tracker_checkbox=yes (the onboarding opt-in) as consent, and any visitor can post to the REST API.
Метод класса: AbilitiesTracking{}
Хуков нет.
Возвращает
bool.
Использование
$result = AbilitiesTracking::is_tracking_allowed(): bool;
Код AbilitiesTracking::is_tracking_allowed() AbilitiesTracking::is tracking allowed WC 11.3.0
private static function is_tracking_allowed(): bool {
try {
return 'yes' === get_option( 'woocommerce_allow_tracking' ) && \WC_Site_Tracking::is_tracking_enabled();
} catch ( \Throwable $e ) {
// The consent filters are third-party code; a failure there must not break the ability call.
return false;
}
}