pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.06k stars 265 forks source link

Add support for conditional logic in multiple selection field #7272

Open arturofez opened 4 months ago

arturofez commented 4 months ago

Problem to Solve

The conditional logic cannot be applied when the target field is a relationship with a simple custom list, and the selection type is set to multiple.

For instance:

Captura de pantalla 2024-03-03 a las 20 24 08

Simple list multiple field

The 'Simple list multiple field' is a relationship field with a Simple type:

Captura de pantalla 2024-03-03 a las 20 24 39

Selection type: multiple selection

Captura de pantalla 2024-03-03 a las 20 28 48

Field with conditional logic

Captura de pantalla 2024-03-03 a las 20 26 05

The conditional logic is never applied because the comparison is from a value to an array, as can be seen in the browser JS console:

Captura de pantalla 2024-03-03 a las 20 30 51

Proposed Solution

Introduce new comparison operators in the conditional logic selection, specifically for multiple selection target fields: 'contains' and 'does not contain':

Captura de pantalla 2024-03-03 a las 20 35 22

Possible Workaround

No response

Examples Elsewhere

No response

Screenshots / Screencast

No response