Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

How to check if at least one key of array is true?

$
0
0

Replies: 0

Hi there,

I have this code:

{% if member %}

{% for item in member %}

{% if item.status == 'wcm-active' %}

...

{% endif %}
{% endfor %}
{% endif %}

How can I get to simplify this code with something like {% if member.item.status %}? I don’t even know if this is possible.

I’m trying to check if AT LEAST one item in the loop of member have the ‘wcm-active’ status.

Thanks for advance for the great plugin! Been using it in all my projects.


Viewing all articles
Browse latest Browse all 59525

Trending Articles