bbp_get_replies_pagination_base( int $topic_id )

Return the base URL used inside of pagination links


Description Description


Parameters Parameters

$topic_id

(Required)


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/replies/template.php

function bbp_get_replies_pagination_base( $topic_id = 0 ) {

	// If pretty permalinks are enabled, make our pagination pretty
	if ( bbp_use_pretty_urls() && ! bbp_is_topic_pending( $topic_id )) {

		// User's replies
		if ( bbp_is_single_user_replies() ) {
			$base = bbp_get_user_replies_created_url( bbp_get_displayed_user_id() );

		// Root profile page
		} elseif ( bbp_is_single_user() ) {
			$base = bbp_get_user_profile_url( bbp_get_displayed_user_id() );

		// Page or single post
		} elseif ( is_page() || is_single() ) {
			$base = get_permalink();

		// Single topic
		} else {
			$base = get_permalink( $topic_id );
		}

		$base = trailingslashit( $base ) . user_trailingslashit( bbp_get_paged_slug() . '/%#%/' );

	// Unpretty permalinks
	} else {
		$base = add_query_arg( 'paged', '%#%' );
	}

	// Filter & return
	return apply_filters( 'bbp_get_replies_pagination_base', $base, $topic_id );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.