Automattic\WooCommerce\Admin\RemoteInboxNotifications

BaseLocationStateRuleProcessor::process()publicWC 1.0

Performs a comparison operation against the base location - state.

Method of the class: BaseLocationStateRuleProcessor{}

No Hooks.

Return

true|false. The result of the operation.

Usage

$BaseLocationStateRuleProcessor = new BaseLocationStateRuleProcessor();
$BaseLocationStateRuleProcessor->process( $rule, $stored_state );
$rule(object) (required)
The specific rule being processed by this rule processor.
$stored_state(object) (required)
Stored state.

BaseLocationStateRuleProcessor::process() code WC 8.7.0

public function process( $rule, $stored_state ) {
	$base_location = wc_get_base_location();
	if ( ! is_array( $base_location ) || ! array_key_exists( 'state', $base_location ) ) {
		return false;
	}

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