Completed
Push — master ( c44b6e...26c5d0 )
by Marin
8s
created

functions.php ➔ carbon_pagination()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 2
b 0
f 0
nc 2
nop 3
dl 0
loc 9
ccs 0
cts 5
cp 0
crap 6
rs 9.6666
1
<?php
2
3
/**
4
 * A lazy way to build, configure and display a new pagination.
5
 *
6
 * @param string $pagination The pagination type, can be one of the following:
7
 *    - Posts
8
 *    - Post
9
 *    - Comments
10
 *    - Custom
11
 * @param array $args Configuration options to modify the pagination settings.
12
 * @param bool $echo Whether to display or return the output. True will display, false will return.
13
 */
14
function carbon_pagination( $pagination, $args = array(), $echo = true ) {
15
	$output = Carbon_Pagination_Presenter::display( $pagination, $args, false );
16
17
	if ( ! $echo ) {
18
		return $output;
19
	}
20
21
	echo wp_kses( $output, wp_kses_allowed_html( 'post' ) );
22
}