I am using the WordPress multisite feature with Multilingual Press Pro to create a multilingual site with linked posts.
In a network activated plugin the custom post types are registered. For translating the slug I use l10n:
'rewrite' => array(
'slug' => __( 'products', 'text-domain' ) . '/%product-category%',
'with_front' => false
)
This works fine. But, to link to the translated post on another site within the network, switch_to_blog()
is used. As within this function no plugins are (re-)loaded, my translation files are also not loaded so the permalinks I retrieve will be wrong.
Is there any possibility to hook into switch_to_blog()
to load another text domain?
Thanks!