WPML compatibility
-
This is David from the WPML compatibility team.
We had a few reports about WPML not working well together with Google XML Sitemaps and tried to find a workaround for our common users.The main problem is that Google XML Sitemaps uses custom DB queries and WPML doesn’t hook on custom queries to modify them.
I wrote this little snippet and so far it has been working for our users:
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) { add_filter( 'option_sm_options', 'sm_wpml_exclude' ); } function sm_wpml_exclude( $value ) { global $wpdb; $ids = $wpdb->get_col( $wpdb->prepare( "SELECT element_id FROM {$wpdb->prefix}icl_translations" . " WHERE element_type LIKE 'post_%%' AND language_code <> '%s'", ICL_LANGUAGE_CODE ) ); $value['sm_b_exclude'] = $ids; return $value; }I’m writing to find out if you are willing to include these lines in your plugin.
If you will, we can add your plugin to our list of compatible plugins:https://wpml.org/documentation/plugins-compatibility/
Let me know what you think.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘WPML compatibility’ is closed to new replies.