bbp_get_author_display_name( int $post_id )
Return the author display-name of a topic or reply.
Description Description
Convenience function to ensure proper template functions are called and correct filters are executed. Used primarily to display topic and reply author information in the anonymous form template-part.
Parameters Parameters
- $post_id
-
(Required)
Return Return
(string) The name of the author
Source Source
File: includes/users/template.php
function bbp_get_author_display_name( $post_id = 0 ) { // Define local variable(s) $retval = ''; // Topic edit if ( bbp_is_topic_edit() ) { $retval = bbp_get_topic_author_display_name( $post_id ); // Reply edit } elseif ( bbp_is_reply_edit() ) { $retval = bbp_get_reply_author_display_name( $post_id ); // Not an edit, so rely on current user cookie data } else { $retval = bbp_get_current_anonymous_user_data( 'name' ); } // Filter & return return apply_filters( 'bbp_get_author_display_name', $retval, $post_id ); }
Changelog Changelog
Version | Description |
---|---|
2.5.0 | Introduced. |