I’m not sure if it’s the same situation described above, but after further testing PLL 1.2dev54, I found out why the Yoast’s SEO wpml-config.xml file was not loading into my Polylang’s String Translation tab.
I have a WordPress multi-site installation, and I install all my plugins from my Network Admin Dashboard and do a site wide network activation.
If you do this, when you go out of your Network Admin Dashboard into a specific site dashboard and look for plugins, you’re going to find none. This happens unless you deactivate them in your Network Admin Dashboard. Then you are going to find them on a per-site basis and will have the option to activate them for a specific site only.
For me, this represents that if I do a get_option(‘active_plugins’), I’m going to get no plugin information at all.
Polylang currently checks for plugins activated on a single site installation or per-site basis only:
...polylang/include/wpml-compat.php, line 472
// plugins
foreach (get_option('active_plugins') as $plugin) {
if (file_exists($file = dirname(POLYLANG_DIR).'/'.dirname($plugin).'/wpml-config.xml'))
$this->xml_parse(file_get_contents($file), dirname($plugin));
}
What I did, is to check for get_site_option(‘active_sitewide_plugins’), and this will pull all the network activated plugins paths, and this will allow Polylang to read and integrate their wpml-config.xml data into the String Translation tab:
// network activated plugins
foreach (get_site_option( 'active_sitewide_plugins') as $plugin => $time ) {
if (file_exists($file = dirname(POLYLANG_DIR).'/'.dirname($plugin).'/wpml-config.xml'))
$this->xml_parse(file_get_contents($file), dirname($plugin));
}
And now all of Yoast’s SEO metadata is shown to me at the Strings Translation tab ready for me to translate.
It’s important to keep both code snippets in that file because of what I described in the bold paragraph.
Chouby, I hope you can add this to the next Polylangs’ dev.
Thank you, Chouby!