HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpamazingsecret/wp-content/themes/porto/woocommerce/loop/pagination.php
<?php
/**
 * Pagination - Show numbered pagination for catalog pages
 *
 * @version     3.3.1
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

global $wp_query, $porto_settings, $porto_layout;

$builder_id = porto_check_builder_condition( 'shop' );

if ( $porto_settings['category-item'] ) {
	$per_page = explode( ',', $porto_settings['category-item'] );
} else {
	$per_page = explode( ',', '12,24,36' );
}

if ( $builder_id && empty( $_GET['count'] ) ) {
	$page_count = '';
} else {
	$page_count = porto_loop_shop_per_page();
}

$total = isset( $total ) ? $total : $wp_query->max_num_pages;

echo '<nav class="woocommerce-pagination' . ( isset( $porto_settings['product-infinite'] ) && 'load_more' == $porto_settings['product-infinite'] ? ' pagination load-more' : '' ) . '">';

	?>
	<form class="woocommerce-viewing" method="get">

		<label><?php esc_html_e( 'Show', 'woocommerce' ); ?>: </label>

		<select name="count" class="count">
		<?php if ( $builder_id ) : ?>
			<option value="" <?php selected( $page_count, '' ); ?>><?php esc_html_e( 'Default', 'porto' ); ?></option>
		<?php endif; ?>
			<?php foreach ( $per_page as $count ) : ?>
				<option value="<?php echo esc_attr( $count ); ?>" <?php selected( $page_count, $count ); ?>><?php echo esc_html( $count ); ?></option>
			<?php endforeach; ?>
		</select>

		<input type="hidden" name="paged" value=""/>

		<?php

		// Keep query string vars intact
		foreach ( $_GET as $key => $val ) {
			if ( 'count' === $key || 'submit' === $key || 'paged' === $key ) {
				continue;
			}

			if ( is_array( $val ) ) {
				foreach ( $val as $innerVal ) {
					echo '<input type="hidden" name="' . esc_attr( $key ) . '[]" value="' . esc_attr( $innerVal ) . '" />';
				}
			} else {
				echo '<input type="hidden" name="' . esc_attr( $key ) . '" value="' . esc_attr( $val ) . '" />';
			}
		}
		?>
	</form>
<?php

if ( $total <= 1 || ( isset( $porto_settings['shop_pg_type'] ) && 'none' != $porto_settings['shop_pg_type'] ) ) {
	echo '</nav>';
	return;
}

	$size_count = 3;

if ( in_array( $porto_layout, porto_options_sidebars() ) ) {
	$size_count = 2;
}

	echo paginate_links(
		apply_filters(
			'woocommerce_pagination_args',
			array(
				'base'      => isset( $base ) ? $base : esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', get_pagenum_link( 999999999, false ) ) ) ),
				'format'    => isset( $format ) ? $format : '',
				'add_args'  => false,
				'current'   => max( 1, isset( $current ) ? $current : get_query_var( 'paged' ) ),
				'total'     => $total,
				'prev_text' => '',
				'next_text' => isset( $porto_settings['product-infinite'] ) && 'load_more' == $porto_settings['product-infinite'] ? esc_html__( 'Load More...', 'porto' ) : '',
				'type'      => 'list',
				'end_size'  => $size_count,
				'mid_size'  => floor( $size_count / 2 ),
			)
		)
	);
	?>
</nav>