I just hooked into EM_TAXONOMY_CATEGORY_SLUG which is defined in em-posts.php and which I think is the one I need to change to alter the URL. It seems to work on Events > Settings > Pages > Permalink Slugs, the Event Categories field changes for English and Spanish, however it does not work anywhere on the site, I still get:
es-ES: https://mysite.com/eventos/categorias/conciertos
en-US: https://mysite.com/en/eventos/categorias/concerts
This is the filter I’m using:
function em_wpml_dbem_taxonomy_category_slug($option){
$lang = get_bloginfo('language');
if( $lang === 'es-ES' ){
$option = 'eventos/categorias';
} else {
$option = 'events/categories';
}
return $option;
}
add_filter('pre_option_dbem_taxonomy_category_slug', 'em_wpml_dbem_taxonomy_category_slug');
add_filter(‘option_dbem_taxonomy_category_slug’, ’em_wpml_dbem_taxonomy_category_slug’);
Note that I used a pre_option and option filter to just to make sure, in case the option_ was not enough…
It seems like the plugin is using the database option value to build all urls and this bypasses my filter, is that so?