Use of localization functions within register_taxonomy in functions.php
-
Hi
I’m having an issue where I can’t use my theme’s translation for my custom taxonomies in functions.php. I want to be able to do this:
function foo() { register_taxonomy( 'genre', 'post', array( 'labels' => array( 'name' => __('Genres'), 'singular_name' => __('Genre') ), 'rewrite' => array('slug' => __('genre')), 'capabilities' => array( 'assign_terms' => 'edit_posts', 'edit_terms' => 'manage_categories' ) ) ); } add_action('after_theme_setup', 'foo');
Where
__('Genre')
never gets translated in functions.php, but in single.php it works. Maybe I just haven’t found the right hook for the function yet? I’ve tried using init, after_theme_setup, load_textdomain.Does anyone know how to make this work, or isn’t it possible?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Use of localization functions within register_taxonomy in functions.php’ is closed to new replies.