Page of
add_query_arg('paged', '%#%'),
'format' => '',
'current' => $current_page,
'total' => $total_pages,
'prev_text' => '‹ Previous',
'next_text' => 'Next ›',
'type' => 'array',
'end_size' => 1,
'mid_size' => 2,
'add_args' => array(
'view' => $current_view,
'status' => $status_filter,
'recurring' => $recurring_filter,
'client_id' => $client_filter ?: false,
)
);
$top_pagination_links = paginate_links($top_pagination_args);
if ($top_pagination_links) {
echo '
';
foreach ($top_pagination_links as $link) {
// Add null check to prevent passing null to easy_invoice_str_replace
if ($link === null) {
continue;
}
// Convert WordPress pagination to our styling
$link = easy_invoice_str_replace('page-numbers', 'px-3 py-2 text-sm font-medium border border-gray-300 rounded-md', $link);
$link = easy_invoice_str_replace('current', 'bg-indigo-50 border-indigo-500 text-indigo-600', $link);
$link = easy_invoice_str_replace('prev', 'bg-white text-gray-500 hover:bg-gray-50', $link);
$link = easy_invoice_str_replace('next', 'bg-white text-gray-500 hover:bg-gray-50', $link);
$link = easy_invoice_str_replace('dots', 'bg-white text-gray-700', $link);
// Add default styling for regular page numbers
if ($link && strpos($link, 'bg-indigo-50') === false && strpos($link, 'bg-white') === false) {
$link = easy_invoice_str_replace('border-gray-300', 'border-gray-300 bg-white text-gray-500 hover:bg-gray-50', $link);
}
echo $link;
}
echo '
';
}
?>