I want to add a data argument to links generated by the paginate_links()
function. Then, I can more easily extend my custom pagination to use AJAX.
As far as I can tell, this function is not pluggable, nor does it have any hooks available.
The links generated by paginate_links()
look like this:
<a class="page-numbers" href="https://example.com/list/page/2/"><span class="screen-reader-text">Page </span>2</a>
I want to add the data-page argument to the <a>
tag so it looks like this:
<a data-page="2" class="page-numbers" href="https://example.com/list/page/2/"><span class="screen-reader-text">Page </span>2</a>
What would be the best way to edit a Core WordPress function that is not pluggable?