Closed land0r closed 1 year ago
For numeric ACF values, there is no proper working for the rule set because the condition in PHP is strict - https://github.com/ndiego/block-visibility/blob/main/includes/frontend/visibility-tests/acf.php#L205
If you remove === to == or try to add some type for this check, there will be the desired result.
===
==
You will see this block because the code tries to compare 12 == '12' (integer with string but without strict comparison)
You will not see this block because the code tries to compare 12 === '12' (integer with string)
I totally agree with you, it's a very annoying thing
@land0r Thanks for reporting this, and I apologize for the delayed reply. This will be fixed in the next version, scheduled for 2022-12-05.
Description
For numeric ACF values, there is no proper working for the rule set because the condition in PHP is strict - https://github.com/ndiego/block-visibility/blob/main/includes/frontend/visibility-tests/acf.php#L205
If you remove
===
to==
or try to add some type for this check, there will be the desired result.Step-by-step reproduction instructions
Expected behavior
You will see this block because the code tries to compare 12 == '12' (integer with string but without strict comparison)
Actual behavior
You will not see this block because the code tries to compare 12 === '12' (integer with string)
Screenshots or screen recording (optional)
System information