AnsPress_Rewrite::pagination_fix( array $args )
Description #
Pagination fix.
Parameters #
- $argsarray (Required) Arguments.
Source #
File: includes/rewrite.php
public static function pagination_fix( $args ) {
/**
* Home page pagination fix,
* when the questions are directly used within the loop,
* i.e., without setting the static front page.
*
* @param array $args Arguments.
* @return array
*/
if ( is_front_page() && is_home() ) {
return preg_replace( '/page.([0-9]+).*/', '?page=$1', $args );
}
/**
* BuddyPress pagination fix.
*/
if ( function_exists( 'bp_current_component' ) ) {
$bp_com = bp_current_component();
if ( 'questions' === $bp_com || 'answers' === $bp_com ) {
return preg_replace( '/page.([0-9]+)./', '?paged=$1', $args );
}
}
return $args;
}
Expand full source code Collapse full source code View on GitHub: includes/rewrite.php:192
Add your comment