Hey @lukascech,
Took some time but I finally managed to test SO’s Page Builder.
Indeed, the WPP widget won’t load but only when ajaxified (Settings > WordPress Popular Posts > Tools > Ajaxify widget). Disabling the Ajaxify widget option will have WPP render correctly when used with SiteOrigin’s Page Builder.
Somehow, during the process both the $widget_id and the instance ID ($id) of the WPP widget -assigned by WordPress- get changed:
- WPP’s widget ID is changed from wpp-[ID] (eg. wpp-2) to widget-[grid index][cell index][widget index] (eg. widget-0-0-1),
- WPP’s instance ID changes from [ID] (eg. 2) to [post ID][some number I don’t know where it comes from][grid index][cell index][widget index] (eg. 9351001). I suspect it’s because of what happens in #1 but didn’t dig into SO Page Builder’s code too deep though so I’m not sure.
So:
- When WPP’s done executing its AJAX script it tries to find a container with ID widget-0-0-1 to inject the response, and since it doesn’t exist the script fails to do so (the response will be empty anyways, see below why).
- When WPP receives the AJAX request, it tries to find the widget instance #9351001 (instead of 2 in our example above), and since it doesn’t exist the widget returns nothing.
I’m not sure if this is something that can be fixed from WPP’s side but I’ll look into it. Maybe @gpriday can help understand why this happens and provide suggestions?
For now, the only way the WPP widget can function normally when inserted via SO Page Builder -as stated before- is by disabling the Ajaxify widget feature.