bbp_get_author_url( int $post_id )

Return the author url of a topic or reply.

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 user form template-part.

Parameters

$post_id

(int) (Required)

Return

(string) The url of the author

Source

File: bp-forums/users/template.php

	function bbp_get_author_url( $post_id = 0 ) {

		// Define local variable(s)
		$retval = '';

		// Topic edit
		if ( bbp_is_topic_edit() ) {
			$retval = bbp_get_topic_author_url( $post_id );

		// Reply edit
		} elseif ( bbp_is_reply_edit() ) {
			$retval = bbp_get_reply_author_url( $post_id );

		// Not an edit, so rely on current user cookie data
		} else {
			$retval = bbp_current_anonymous_user_data( 'url' );
		}

		return apply_filters( 'bbp_get_author_url', $retval, $post_id );
	}

Changelog

Changelog
Version Description
bbPress (r5119) 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.