Fix marketing task not displaying on Atomic sites. (https://github.com/woocommerce/woocommerce-admin/pull/8150)

* Should accept a boolean value for is_visible property with an extension, and only evaluate a set of rules

* Adding changelog

* Moving fix to RuleEvaluator so it applies to other rulesets
This commit is contained in:
Joel Thiessen 2022-01-12 17:39:22 -08:00 committed by GitHub
parent fec3ab8c5e
commit 512a4fac7a
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: Fix
Fixing marketing task not displaying on Atomic sites #8150

View File

@ -37,6 +37,11 @@ class RuleEvaluator {
* @return bool The result of the operation. * @return bool The result of the operation.
*/ */
public function evaluate( $rules, $stored_state = null, $logger_args = array() ) { public function evaluate( $rules, $stored_state = null, $logger_args = array() ) {
if ( is_bool( $rules ) ) {
return $rules;
}
if ( ! is_array( $rules ) ) { if ( ! is_array( $rules ) ) {
$rules = array( $rules ); $rules = array( $rules );
} }