Support » Requests and Feedback » translate_user_role() not working in themes

  • I’m trying to translate user roles inside a template but translate_user_role( 'Author' ), which is working fine in admin doesn’t work after theme load.
    I tried to track back where the function get his data but a var_dump of get_translations_for_domain( $domain ), inside the template, doesn’t give back user roles… Any clue ?!?

    * Echo the post author role
    * Known issue: The translation is not working on front-end
    * @since 0.0.1
    function ngrigo_post_author_role() {

    global $post, $wp_roles;
    $author_info = get_userdata( $post->post_author );
    echo translate_user_role( $wp_roles->role_names[ $author_info->roles[0] ] );


  • The topic ‘translate_user_role() not working in themes’ is closed to new replies.