Automattic\WooCommerce\Admin\RemoteInboxNotifications
PluginVersionRuleProcessor::process()
Process the rule.
Method of the class: PluginVersionRuleProcessor{}
No Hooks.
Return
true|false
. Whether the rule passes or not.
Usage
$PluginVersionRuleProcessor = new PluginVersionRuleProcessor(); $PluginVersionRuleProcessor->process( $rule, $stored_state );
- $rule(object) (required)
- The specific rule being processed by this rule processor.
- $stored_state(object) (required)
- Stored state.
PluginVersionRuleProcessor::process() PluginVersionRuleProcessor::process code WC 8.7.0
public function process( $rule, $stored_state ) { $active_plugin_slugs = $this->plugins_provider->get_active_plugin_slugs(); if ( ! in_array( $rule->plugin, $active_plugin_slugs, true ) ) { return false; } $plugin_data = $this->plugins_provider->get_plugin_data( $rule->plugin ); if ( ! is_array( $plugin_data ) || ! array_key_exists( 'Version', $plugin_data ) ) { return false; } $plugin_version = $plugin_data['Version']; return version_compare( $plugin_version, $rule->version, $rule->operator ); }