Skip Navigation

[Resolved] Shortcode not running on ajax refresh

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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

This topic contains 2 replies, has 2 voices.

Last updated by Mateus Getulio 4 months, 2 weeks ago.

Assisted by: Mateus Getulio.

Author
Posts
#2743774

We have a custom shortcode that loads great on the initial load of an ajax view.

Once we filter the results the shortcode does not run on the filter results.

Can you please assist us in this?

#2744356

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

To suggest the best way to achieve this, I'll need to see how this view is set up in the admin area.

Can you please share temporary admin login details along with a link to a page where this view can be seen?

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Mateus

#2745142

Mateus Getulio
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello there,

I checked it and it looks like the player is also loading with an ajax call rather than being immediately available, is this something that's customizable? Could you let it fixed in the page to avoid this conflict with the Toolset ajax calls?

I checked their plugin and it looks like there's some code meant to remove the player depending on the type of event:

delete window.generated_the_eddmp; 

This could be the culprit but it needs some double-checking.

To help address this, I recommend contacting the plugin developers of 'Music Player for Easy Digital Downloads'. Please explain that the audio player works correctly on initial page load but disappears or fails to reload after using AJAX filters provided by Toolset Views. Suggest that the issue could be related to the player not being re-initialized properly after the AJAX call, which might be preventing it from rendering on the page.

Also, please mention that they can use the following jQuery function to catch the Toolset AJAX filter events and execute the necessary code to load or reinitialize the player:

jQuery(document).on('js_event_wpv_pagination_completed js_event_wpv_parametric_search_results_updated', function(event, data) {
    // Code to reinitialize or reload the player
});

This function triggers whenever an AJAX event completes, which should allow them to re-run any initialization code required to display the player correctly. It looks like there's a function eddmp_force_init() within the file music-player-for-easy-digital-downloads/js/public_src.js that can be used to rebuild the player but I couldn't get it to work, not even directly in the console.

By providing this information to the plugin developers, they might be able to offer more targeted support or suggest an alternative method to ensure the player displays correctly after filtering.

Please feel free to follow up if they provide you with new information so that we can reassess it.

Best regards,
Mateus