bbp_get_topic_author_role( array $args = array() )
Return the topic author role
Description
Parameters
- $args
-
(Optional)
Default value: array()
Return
(string) topic author role
Source
File: bp-forums/topics/template.php
1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 | function bbp_get_topic_author_role( $args = array () ) { // Parse arguments against default values $r = bbp_parse_args( $args , array ( 'topic_id' => 0, 'class' => 'bbp-author-role' , 'before' => '' , 'after' => '' ), 'get_topic_author_role' ); $topic_id = bbp_get_topic_id( $r [ 'topic_id' ] ); $role = bbp_get_user_display_role( bbp_get_topic_author_id( $topic_id ) ); $author_role = sprintf( '%1$s<div class="%2$s">%3$s</div>%4$s' , $r [ 'before' ], $r [ 'class' ], $role , $r [ 'after' ] ); return apply_filters( 'bbp_get_topic_author_role' , $author_role , $r ); } |
Changelog
Version | Description |
---|---|
bbPress (r3860) | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.