• Resolved rodandar

    (@rodandar)


    I am trying to control block visibility on a paragraph using a rule on an Advanced Custom Field. The Visibility settings are aware of the field, but it will not match on the text I enter. It behaves as if that field is not set at all, however, it is listed in the user listing and you can see the value when you edit the user. The visibility control will display the paragraph if the rule is display if the field is not set. Two different users, with different values of that field, won’t show the field. But the field will display for both users if the rule is ‘Has no value’. Any thoughts on what could be going wrong?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Nick Diego

    (@ndiego)

    Hi @rodandar,

    Thanks for opening a support ticket and I apologize for the trouble. Are you able to tell me a bit more info about the field you are using? For example the the “type” of the field and any conditional logic on the field itself (in ACF). I will then attempt to replicate on my end.

    Also are you testing the field in “Preview” mode? Unfortunately, there is a known issue where the field settings cannot be fetched in WordPress preview even though the settings are actually working.

    Let me know. Thanks!

    Nick

    Thread Starter rodandar

    (@rodandar)

    Hi Nick,

    Thanks for the quick response. I am not testing this in Preview mode.

    I have an ACF with the label batch-id and two users each with the batch-id field and a value of cc001 and cc002.

    I have a visibility rule that basically says if batch-id equals ‘cc001’ then show the field.

    When this rule is enabled, it doesn’t show the paragraph for either user. If the rule is set to ‘Has no value’, the paragraph shows for both users.

    -Dan

    Plugin Author Nick Diego

    (@ndiego)

    Hi Dan,

    Thanks for the follow up. One more quick question. Is the ACF applied to each user or the page that the block is on? It sounds like its applied at the user level, but just wanted to double check.

    Thanks,
    Nick

    Thread Starter rodandar

    (@rodandar)

    Nick,

    It is applied on the user for all roles. It is a basic text field.

    Thanks.

    -Dan

    Plugin Author Nick Diego

    (@ndiego)

    Hi Dan,

    After doing a bit of investigating, you are correct. This functionality is not currently possible. The control looks at the fields applied to the current post, page, or custom post type when evaluating the conditionals. It does not look for any field values attached to the users. Since the page did not have a “batch-id”, only the users did, that is why the block was displaying.

    That said, I see great value in adding this functionality and I appreciate you bringing this to my attention. I have added a Feature Request issue on GitHub (where the plugin is being developed), and it will get included in version 2.1.0. We are looking at about mid-August for this, maybe sooner. I will also be updating the documentation on this control so the existing functionality is more clear.

    Since we are aware of “why” this is happening, I am going to switch this ticket over to a “Feature Request” ticket, but I will provide an update as soon as this functionality is available in the plugin.

    Thanks again for alerting me to this, and if I can be of any further assistance, let me know!

    Best,
    Nick

    Plugin Author Nick Diego

    (@ndiego)

    Hi Dan,

    It took a bit longer to get version 2.1.0 out than expected, but ACF fields attached to users is now supported in the most recent release.

    If I can be of any further assistance, let me know!

    Best,
    Nick

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘ACF rules not working’ is closed to new replies.