Hello !
I use Polylang on my websites, and Site Origin to handle content page.
Recently, I’ve noticed that I have a problem when I create a new translation for a page builded with Site Origin : widgets aren’t loaded in the content admin page. It was working before, so I guessed that something have been changed in latest versions of the siteoriginbuilder plugin, and I’ve found what cause my problem : it’s the new feature “WPML: Improved compatibility by excluding panels_data“.
For the context, when I create a new translation, I have a function that copy the content page of the original post that you can see here :
function traduction_content_copy( $content ) { if ( isset( $_GET['from_post'] ) ) { $my_post = get_post( $_GET['from_post'] ); if ( $my_post ) return $my_post->post_content; } return $content; } add_filter( 'default_content', 'traduction_content_copy' );
The addition of this line in the “wpml-config.xml” file is the origin of the problem :
<custom-fields> <custom-field action="ignore">panels_data</custom-field> </custom-fields>
I don’t really know why, so I hope you could find a solution for polylang to not be concerned by this line.
Thank you for your support !
I’ve noticed that the “admin-ajax.php?_panelsnonce=xxxxx” function is not called on my post-new.php admin page with the new line in “wpml-config.xml”. If I remove it, the panelsnonce is called and widgets are loaded.
Hi Xella,
Thanks for getting in touch. Are you using Polylang Pro or the base version?
We made a change in Page Builder 2.31.8 that resolves this compatibility issue for the pro version of Poylang, but the free version of the plugin doesn’t feature direct syncing support. This means that if the PHP you provided is the full extent of the syncing functionality you rely on, you may require additional changes to prevent Polylang from intentionally filtering out panels_data. You can find a copy of the compatibility changes we made here.
Kind regards,
Alex
Hello Alex,
I use the free version of Polylang. I use a custom code to copy original post content to the translation (the function that I add in my initial message). I’ve find a way to copy panels_data when creating a translation. I’ve created a custom filter, so when I create a new translation, I copy the page builder content from the original post :
It resolve my issue, but I think you could fix this problem by doing the same thing in the page builder polylang file, in the function “copy_panels_data”, you could do it like this, as it was in the function before the upgrade of version 23.3.1.3 (https://github.com/siteorigin/siteorigin-panels/blob/4c9e032b2107f01ae29c16466fd5c302962501b7/compat/polylang.php) :