Making MasterSlider work with qTranslateX

If you'd tried using the inline translation with MasterSlider like so: [:en]English[:zh]Chinese[:], you'll realise it doesn't work properly but throws out the exact string as you entered.


In masterslider/includes/msp-shortcodes.php, look for msp_masterslider_layer_shortcode function.

Scroll down until you see this line, or you can just search for it:

$layer_content .= ! empty( $content ) ? do_shortcode( wp_unslash( $content ) ) : '';

Simply wrap $content with __().

Final line:

$layer_content .= ! empty( $content ) ? do_shortcode( wp_unslash( __($content) ) ) : '';

I had requested the team to add the wrapper too. Hopefully they'll add it in the next release.

Making MasterSlider work with qTranslateX
Share this