<?php
/**
 * Template: Jobs Pagination
 *
 * Override this in your theme by copying it to wp-content/themes/{yourtheme}/matador/jobs-pagination.php.
 *
 * @link        https://matadorjobs.com/
 * @since       3.4.0
 *
 * @package     Matador Jobs
 * @subpackage  Templates
 * @author      Matador Software LLC, Jeremy Scott, Paul Bearne
 * @copyright   (c) 2018-2021, Matador Software, LLC
 *
 * @license     https://opensource.org/licenses/GPL-3.0 GNU General Public License version 3
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Defined before include:
 *
 * @var array $args
 */

$args['before_page_number'] = '<span class="matador-screen-reader-text">' . esc_html__( 'Page ', 'matador-jobs' ) . ' </span>';
$args['after_page_number']  = '';
?>

<?php
/**
 * Action: Before Pagination
 * @wordpress-action `matador_template_jobs_pagination_before`
 *
 * @since 3.9.0
 */
do_action( 'matador_template_jobs_pagination_before' );
?>

<div class="matador-pagination">

	<?php
	/**
	 * Action: Before Pagination Links in Pagination Wrapper
	 * @wordpress-action `matador_template_jobs_pagination_before_links`
	 *
	 * @since 3.9.0
	 */
	do_action( 'matador_template_jobs_pagination_before_links' );

	/**
	 * Filter: Before Pagination
	 * @wordpress-filter `matador_template_jobs_pagination_args`
	 *
	 * @since 3.9.0
	 *
	 * @param array $args An array of args fed into @see pagination_links() [
	 *   @var string $before_page_number HTML for before the page number.
	 *   @var string $after_page_number HTML for after the page number.
	 * ]
	 * @return array
	 */
	apply_filters( 'matador_template_jobs_pagination_args', $args );
	?>

	<?php echo wp_kses_post( paginate_links( $args ) ); ?>

	<?php
	/**
	 * Action: After Pagination in Pagination Wrapper
	 * @wordpress-action `matador_template_jobs_pagination_after_links`
	 *
	 * @since 3.9.0
	 */
	do_action( 'matador_template_jobs_pagination_after_links' );
	?>
</div>

<?php
/**
 * Action: After Pagination
 * @wordpress-action `matador_template_jobs_pagination_after`
 *
 * @since 3.9.0
 */
do_action( 'matador_template_jobs_pagination_after' );
?>