Automattic\WooCommerce\Admin\RemoteInboxNotifications

BaseLocationCountryRuleProcessor::process()publicWC 1.0

Performs a comparison operation against the base location - country.

{} Это метод класса: BaseLocationCountryRuleProcessor{}

Хуков нет.

Возвращает

true|false. The result of the operation.

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

$BaseLocationCountryRuleProcessor = new BaseLocationCountryRuleProcessor();
$BaseLocationCountryRuleProcessor->process( $rule, $stored_state );
$rule(объект) (обязательный)
The specific rule being processed by this rule processor.
$stored_state(объект) (обязательный)
Stored state.

Код BaseLocationCountryRuleProcessor::process() WC 7.1.0

public function process( $rule, $stored_state ) {
	$base_location = wc_get_base_location();
	if ( ! $base_location ) {
		return false;
	}

	// Return false if the location is the default country and if onboarding hasn't been finished or the store address not been updated.
	if ( 'US' === $base_location['country'] && 'CA' === $base_location['state'] && empty( get_option( 'woocommerce_store_address', '' ) ) && OnboardingProfile::needs_completion() ) {
		return false;
	}

	return ComparisonOperation::compare(
		$base_location['country'],
		$rule->value,
		$rule->operation
	);
}