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

	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

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.