Author Archives title - WPML Compatibility

If WPML String Translation is used to have multilingual author names, this change is needed to persist the translation to the title of the Author Archives page.
This commit is contained in:
Anson Kao
2014-03-05 02:21:37 -05:00
parent 8bafd87237
commit b2ca4611f6

View File

@@ -23,7 +23,7 @@ function roots_title() {
return sprintf(__('Yearly Archives: %s', 'roots'), get_the_date('Y')); return sprintf(__('Yearly Archives: %s', 'roots'), get_the_date('Y'));
} elseif (is_author()) { } elseif (is_author()) {
$author = get_queried_object(); $author = get_queried_object();
return sprintf(__('Author Archives: %s', 'roots'), $author->display_name); return sprintf(__('Author Archives: %s', 'roots'), apply_filters('the_author', is_object($author) ? $author->display_name : null));
} else { } else {
return single_cat_title('', false); return single_cat_title('', false);
} }
@@ -34,4 +34,4 @@ function roots_title() {
} else { } else {
return get_the_title(); return get_the_title();
} }
} }