Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors

IsWooExpressRuleProcessor::validate()publicWC 1.0

Validate the rule.

Method of the class: IsWooExpressRuleProcessor{}

No Hooks.

Return

true|false. Pass/fail.

Usage

$IsWooExpressRuleProcessor = new IsWooExpressRuleProcessor();
$IsWooExpressRuleProcessor->validate( $rule );
$rule(object) (required)
The rule to validate.

IsWooExpressRuleProcessor::validate() code WC 9.0.1

public function validate( $rule ) {
	if ( ! isset( $rule->value ) ) {
		return false;
	}

	if ( isset( $rule->plan ) ) {
		if ( ! function_exists( 'wc_calypso_bridge_is_woo_express_plan' ) ) {
			return false;
		}
	}

	return true;
}