', esc_url( get_bloginfo( 'pingback_url' ) ) );
}
}
/*
* Pages Links
*
* @since 1.0.0
*/
public static function link_pages() {
$defaults = array(
'before' => '
' . esc_html__( 'Pages:', 'nextpage' ) . '',
'after' => '
',
'link_before' => '',
'link_after' => '',
'next_or_number' => 'number',
'separator' => ' ',
'pagelink' => '%',
'echo' => 1
);
wp_link_pages( $defaults );
}
/*
* Pagination
*
* @since 1.0.0
*/
function post_pagination( \WP_Query $wp_query = null, $echo = true, $params = [] ) {
if ( null === $wp_query ) {
global $wp_query;
}
$add_args = [];
$pages = paginate_links( array_merge( [
'base' => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var( 'paged' ) ),
'total' => $wp_query->max_num_pages,
'type' => 'array',
'show_all' => false,
'end_size' => 3,
'mid_size' => 1,
'prev_next' => true,
'prev_text' => '',
'next_text' => '',
'add_args' => $add_args,
'add_fragment' => ''
], $params )
);
if ( is_array( $pages ) ) {
$pagination = '';
if ( $echo ) {
echo wp_kses_post( $pagination );
} else {
return $pagination;
}
}
return null;
}
}//end class
}