Can I set is_rtl() to true?
I am adding a section to my site in Pashto, which is a custom Arabic RTL language.
I can figure out how to inject rtl into the html tag and body tag using
add_filter('language_attributes', 'custom_rtl_dir_attr');
add_filter('body_class', 'custom_rtl_body_class');
... but because is_rtl() still returns false, things like the bootstrap rtl css don't get added automatically:
if (is_rtl())
wp_enqueue_style('bootstrap-rtl', //cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.2.0-rc2/css/bootstrap-rtl.min.css, array());
}
What I am really looking for is a way to SET is_rtl() to true, for these pages, so that WP treats them like a native RTL page.
Is there any way to set/override is_rtl() ?
Topic language multi-language Wordpress
Category Web