Skip Navigation

[Resolved] AJAX Filters are wiping ACF fields in my views when it updates the list

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 6 replies, has 2 voices.

Last updated by robina-2 5 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#1277519

I am trying to: Use AJAX filters to narrow down views.

Link to a page where the issue can be seen: Can send link privately.

I expected to see: The filter is clicked and the list is updated.

Instead, I got: The filter is clicked and the list is updated and data is cleared.

#1277615

Hi, private reply fields are available here. Please let me know where I can find this View on the front-end of your site.

#1278951

Sorry, I didn't get the private information I need to log in. Can you try again? At the very least I need the basic HTTP authentication to access the wpengine site. For more direct help, I need your wp-admin login credentials. Thank you!

#1280345

Can you check those HTTP auth credentials from an incognito browser? I'm not able to get authorized.

#1281003

Sorry, try this:

demo/design2

#1281167

Okay I'm not really familiar with the acf_field shortcode, but in general 3rd-party shortcodes don't work well with Views or WordPress Archives AJAX updates unless the shortcodes are specifically designed with AJAX support in mind: https://toolset.com/documentation/user-guides/front-page-filters/#2-1-custom-search-settings

Is there any documentation available online for the acf_field shortcode?

For simple text values you can use the wpv-post-field shortcode to display the raw value from the database. This Views shortcode is AJAX-friendly.

#1281229

Okay, I get it. That's good to know.

Looks like wpv-post-field isn't working because it's not a standard field. It's an acf field. I'll register the acf shortcode with Toolset and then run their shortcode.

And, that worked!

Should anybody come looking for such a solution for ACF and Toolset Views, use the acf shortcode

[acf field="{$field_name}" post_id="{$post_id}"]

replacing with your field name and then use the View's ID shortcode as follows:

[acf field="my_custom_field" post_id="[wpv-post-id]"]

Thanks!