-->

Tuesday, June 20, 2017

Which of the following will correctly load localized (translated) text for a WordPress plugin?

Which of the following will correctly load localized (translated) text for a WordPress plugin?
Answers:
1.      function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); load_theme_textdomain(‘tutsplus’, $lang_dir); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);
2.      function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); add_action(‘after_setup_theme’, ‘custom_theme_setup’); }
3.      function custom_theme_setup() { $lang_dir = get_template_directory() . ‘/lang’); add_action(‘after_setup_theme’, ‘custom_theme_setup’); } load_theme_textdomain(‘tutsplus’, $lang_dir);

4.      function load_theme_textdomain(‘tutsplus’, $lang_dir); { $lang_dir = get_template_directory() . ‘/lang’); custom_theme_setup(); } add_action(‘after_setup_theme’, ‘custom_theme_setup’);
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post
 

Delivered by FeedBurner