WIP: is/is not empty Condition via Props Doesn't Work Correctly With Dynamic Data

Browser: Version 140.0.7312.0 (Official Build) dev (64-bit)
OS: Windows 11 PRO Version 24H2 Build 26100.4652
URL: https://mac.circea.dev/
PHP: 8.3.22
WP: 6.8.2

Description

“is empty” and “is not empty” conditions don’t work properly in components (at least with dynamic data, specifically images).

In the example below, I have a Background Alpha component, with props “condition_target” and “condition_operator”. The “condition_target” property has a default of “1”, and the “condition_operator” has a default of “is not empty” (actual value is !=).

I’ve used a select prop with custom options because the select prop won’t auto populate when attached to the condition operator dropdown. Actually, I think that’s the case for all dropdowns of the condition builder.

The settings of the condition are

  • “Dynamic data”
  • “condition_target : 1”
  • “condition_operator : !=”
  • [empty]

I would expect the condition “1 != empty/false/0” to be true and the image to be displayed by default, but it doesn’t seem to work that way.

In my Hero Section Alpha component I have 2x Background Alpha. The first one should display when “acf_term_image” is not empty, and the second one when “acf_term_image” is empty.

In reality, not only do the conditions not work, but only one Background Alpha is displayed on the front-end, even with both having the exact same condition (either both acf_term_image is empty, or both acf_term_image is not empty; same story with featured_image).

My Footer Alpha footer component should also have a background image, but same story - the behavior is very strange. Conditions seem to be working, but incorrectly. For example, if I set the condition featured_image is not empty (via props) on the Background Alpha component that’s in my footer, the Background Alpha background will display on the front-end, but it SHOULD NOT, as my featured_image is actually empty.

Screenshots





Hi @mihai-circea,

thank you for your report. So, just to be certain, before I create an internal ticket, everything works, until you connect dynamic data to the “compare” part of the condition, right?

Best regards,
Matej

Based on my testing, yes, that seems to be the case.

But I’d also like to know, should a 1 != [empty] condition return true, therefore be a viable default condition to display the element? For some of my components, not all instances will actually have a condition.

Hi @mihai-circea,

thank you for confirming. I’ve created an internal bug report for this.

As for your question, yes, this should show the element:
CleanShot 2025-07-30 at 09.48.08@2x

Best regards,
Matej

1 Like