Skip Navigation

[Resuelto] Third-Party Shortcode Stops Working after Update View Filter

This support ticket is created hace 6 años, 5 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Etiquetado: ,

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por aaronM-9 hace 6 años, 5 meses.

Autor
Mensajes
#911286
temp3.jpg
temp.jpg
temp2.jpg

I have a view that uses a shortcode I developed called [be_get_connection] that calculates how well the user matches another user. It is registered in Toolset settings. When displaying the view, it has been working great. However, I've just noticed that whenever you apply a filter using the search (which is set to update whenever a filter value is changed), the shortcode suddenly stops working. Is there a reason for this? Attached are two screenshots - one when the page first loads and the second is after you check one of the filters.

I can successfully correct the problem if I switch from using AJAX auto-update to doing a full page refresh after clicking a submit button, but I would rather use AJAX so I figured I'd check in with you before I go around updating all the search pages throughout my site (I want consistency on how all the views look and feel). Thanks for any insight.

- Aaron

#911394

Yes, probably there are some values that are calculated with PHP in your shortcode and when you change the filter its AJAX, PHP is not run.

What you can try is retook your actions in the JS Filter Hooks we offer to be fired after a set of events (pagination, search, etc) - this can be done in the JS section of your Filter editor in the views.
But that allows you just to re-hook JS code and functions.

Your code probably relies on some displayed data, does not get updated during the AJAX call and hence fails.

You'd need to use Custom Code to hook to our Toolset AJAX JS filter actions which then can rehandle the operations with the new data presented by the View.

However, this'll require Custom Code that we cannot assist here.

#914358

Thanks. For the time being I've just switched to not using AJAX. I'll revisit the AJAX options again once I've got more free time.

- Aaron