Hi!
I'm using this function to display the author role:
http://core.trac.wordpress.org/attachment/ticket/5290/author-template-the_author_role.diff
function get_the_author_role() {
global $wpdb, $wp_roles, $authordata;
if ( !isset($wp_roles) )
$wp_roles = new WP_Roles();
foreach($wp_roles->role_names as $role => $Role) {
$caps = $wpdb->prefix . 'capabilities';
if (array_key_exists($role, $authordata->$caps))
return $Role;
}
}
/**
* Echo the account role of the author of the current post in the Loop.
* @see get_the_author_role()
* @return null
*/
function the_author_role() {
echo get_the_author_role();
}
(founded here)
and now, I would like to display the author role on comments (like on this wordpress support site); when using this function, it show the same role for all comments ( because it's in reality the role of the author of the commented post).
What can I do?
Thanks