bbp_get_reply_author_role( array $args = array() )

Return the reply author role

Description

Parameters

$args

(Optional)

Default value: array()

Return

(string) Reply author role

Source

File: bp-forums/replies/template.php

1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
function bbp_get_reply_author_role( $args = array() ) {
 
    // Parse arguments against default values
    $r = bbp_parse_args( $args, array(
        'reply_id' => 0,
        'class'    => 'bbp-author-role',
        'before'   => '',
        'after'    => ''
    ), 'get_reply_author_role' );
 
    $reply_id    = bbp_get_reply_id( $r['reply_id'] );
    $role        = bbp_get_user_display_role( bbp_get_reply_author_id( $reply_id ) );
    $author_role = sprintf( '%1$s<div class="%2$s">%3$s</div>%4$s', $r['before'], esc_attr( $r['class'] ), esc_html( $role ), $r['after'] );
 
    return apply_filters( 'bbp_get_reply_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.