Automattic\WooCommerce\Admin\RemoteSpecs\RuleProcessors
PluginVersionRuleProcessor::validate
Validates the rule.
Method of the class: PluginVersionRuleProcessor{}
No Hooks.
Returns
true|false. Pass/fail.
Usage
$PluginVersionRuleProcessor = new PluginVersionRuleProcessor(); $PluginVersionRuleProcessor->validate( $rule );
- $rule(object) (required)
- The rule to validate.
PluginVersionRuleProcessor::validate() PluginVersionRuleProcessor::validate code WC 10.4.3
public function validate( $rule ) {
if ( ! isset( $rule->plugin ) ) {
return false;
}
if ( ! isset( $rule->version ) ) {
return false;
}
if ( ! isset( $rule->operator ) ) {
return false;
}
return true;
}