bbp_get_topic_author_role

Return the topic author role.

Description

(string) bbp_get_topic_author_role( (array) $args = array() ); 

Returns (string)

topic author role

Parameters (1)

0. $args — Optional. (array) => array()
The args.

Usage

  1. if ( !function_exists( 'bbp_get_topic_author_role' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/topics/template.php'; 
  3.  
  4. // The args. 
  5. $args = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_get_topic_author_role($args); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/topics/template.php  
  1. function bbp_get_topic_author_role( $args = array() ) { 
  2.  
  3. // Parse arguments against default values 
  4. $r = bbp_parse_args( $args, array( 
  5. 'topic_id' => 0,  
  6. 'class' => 'bbp-author-role',  
  7. 'before' => '',  
  8. 'after' => '' 
  9. ), 'get_topic_author_role' ); 
  10.  
  11. $topic_id = bbp_get_topic_id( $r['topic_id'] ); 
  12. $author_role = sprintf( '%1$s<div class="%2$s">%3$s</div>%4$s', $r['before'], $r['class'], $role, $r['after'] ); 
  13.  
  14. return apply_filters( 'bbp_get_topic_author_role', $author_role, $r );