-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Or" in conditional logics #839
Comments
If you are talking about But there is a workaround to use OR operator, see #769. |
The workaround is quite dirty though. For example I have select 1 and select 2, both have 10 options each, with this workaround I would have to specify 18 (!) conditions instead of two. |
I agree. I hope they address this in the future versions. |
There are plans to do that in a future release, just not yet. The syntax that will probably be used will be like this: 'required' => array(
array(
array(
),
// OR
array(
),
),
// AND
array(
),
), Right now there are simply more important issues to deal with so this will have to wait for a while... Marking as a feature request 👍 |
Thanks, @aristath! |
This is now implemented in the develop branch, I'd really appreciate it if you guys could test it. Example: 'active_callback' => array(
array(
array(
'setting' => 'setting_1',
'operator' => '==',
'value' => true,
),
array(
'setting' => 'setting_2',
'operator' => '==',
'value' => true,
),
),
array(
'setting' => 'setting_3',
'operator' => '==',
'value' => true,
),
), The above can be translated like this: |
In other words, |
Ahah...I was ready it and it wasn't making sence. Better now :-) |
LOL yeah, there was a typo that I edited. ;) |
@guillaumemolter do you perhaps have any ideas on how to make the syntax easier to understand? |
Hmmm...I think it's pretty clear this way. Personally I may have implemented the |
Just tested this, works like a charm 👍 |
Thanks, it's working. But the syntax really bothers me. Don't think it's flexible enough. I suppose it must be Just the opposite:
Otherwise we can't group conditions:
|
I agree, but unfortunately we can't do that because it would break things for everyone that was using it before the change. |
Sometimes breaking changes are unavoidable. That's why they're breaking ;) Anyway, I think it's better to change it now, before Kirki gains even more users. However it's your product and I can't really complain. It's so great and saved me a lot of time, really. Thanks a lot, really. |
Is it possible to add "or" operator in the conditional logics?
See the syntax from WP_Query:
Please correct me if I'm wrong, but there's no thing like
relation
in Kirki now and it accepts only AND by default.The text was updated successfully, but these errors were encountered: