bbp_paginate_links( array $args = array() )

A convenient wrapper for common calls to paginate_links(), complete with support for parameters that aren’t used internally by bbPress.


Description Description


Parameters Parameters

$args

(Optional)

Default value: array()


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/core/abstraction.php

function bbp_paginate_links( $args = array() ) {

	// Maybe add view-all args
	$add_args = empty( $args['add_args'] ) && bbp_get_view_all()
		? array( 'view' => 'all' )
		: false;

	// Pagination settings with filter
	$r = bbp_parse_args( $args, array(

		// Used by callers
		'base'      => '',
		'total'     => 1,
		'current'   => bbp_get_paged(),
		'prev_next' => true,
		'prev_text' => is_rtl() ? '→' : '←',
		'next_text' => is_rtl() ? '←' : '→',
		'mid_size'  => 1,
		'end_size'  => 3,
		'add_args'  => $add_args,

		// Unused by callers
		'show_all'           => false,
		'type'               => 'plain',
		'format'             => '',
		'add_fragment'       => '',
		'before_page_number' => '',
		'after_page_number'  => ''
	), 'paginate_links' );

	// Return paginated links
	return bbp_make_first_page_canonical( paginate_links( $r ) );
}

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.