Visibility Condition Fragments Bug

Hi there,

using the default header part and adding it to the global header fragment I am unable to hide the header with the conditions in the image below. Other options work, like user ID.

Cheers

Environment info

  • Chrome
  • WordPress version: 6.4.3
  • Cwicly Plugin version: 1.4.2

Hi @T-low,

I think there may be a slight misunderstanding about how conditions work. Your conditions basically show in all cases because you are not doing anything to negate them.

If you want to hide for guests, you will want to add a “Do not show if”:

1 Like

Hi @StrangeTech,

thank you for your reply :+1:

Does this work for you?


I tried with a new local Laragon installation and could still see the header when logged out/ Incognito mode.

image

I only have Cwicly version 1.4.1.2 installed and no caching is active on the wordpress site.

I tested this with Chrome and multiple devices :thinking:

Cheers

I don’t have time to test right now, I know there were some issues with this in the past. If it is not working, here are a couple of possible alternatives that may work:

  1. Use username instead:

Screenshot 2024-04-02 at 09.26.20

  1. Create a shortcode and inside of it call the function in the second condition shown in the following screenshot:

a) Create a shortcode that calls this function:

See here for where to do those:

b) Add a shortcode condition based on what you created in step a:

Screenshot 2024-04-02 at 09.28.01

1 Like

Hi @StrangeTech,

thank you for the reply and all the helpful links.

I used the shortcode option before, but when testing I thought this might be a bug, hence the report.

As your feedback post reads, it seems to be true that this is a bug? So I will leave it as such.

Was a little sad that I saw a function return, but it was not available in the visibility conditioning.

Cheers