There is no filter, but you can set the type
argument to array
when you call paginate_links()
, and then you can run a filter on the returned array.
Example:
$links = array_map(
function( $link ) {
if ( FALSE === strpos( $link, '/page/' ) )
return str_replace( '<a ', '<a data-page="1" ', $link );
return preg_replace(
'~<a (.*)/page/(\d+)~',
'<a data-page="\\2" \\1/page/\\2',
$link
);
},
paginate_links( [ 'type' => 'array' ] )
);
print join( ' | ', $links );
Related Posts:
- Paginate Link generate additional #038; whenever my Url have multiple Query String
- WordPress Pagination Problem
- paginate_links and query vars
- Add css class to Pagination?
- Highlight the first page pagination_links
- paginate_links URL
- Paging with category page
- How to focus to a specific div when page reloads by pagination?
- Why does paginate_links() reload the entire page? and can you make it reload only a specific div?
- How to use multiple paginate_links() in my index.php?
- bones_page_navi and pre_get_posts Action
- paginate_links adds strong element
- How to break the wp_link_pages in two lines
- Changing pagination list class
- changing wp-admin/widgets.php
- How to disable core and plugin updates
- How to share WordPress core library
- Cleaning up WordPress to improve performance?
- paginate_links() don’t properly work in search.php?
- How can I modify what is being output in wp_head, whether by a theme or WordPress in general?
- Modifying the media-template.php file, the right way?
- Paginate links with “ugly” and “pretty” permalinks?
- Strange paginate_links behavior. First page link is always whatever page I’m on, all other links are correct
- How to paginate attachments in a secondary query as gallery?
- Why are double-periods (“..”) invalid in a WordPress image filename?
- Custom Search Page Pagination Not Working
- Paginated pages are showing correct content but pagination links are not
- How to change URL structure for pagination pages?
- How to remove wordpress admin bar in dashboard
- Search – Ajax – Alter Query Parameters with Pagination
- paginate_links() outputs extra empty pages on custom loop
- Two domains on one WordPress Installation
- WP_QUERY loop, offset in the arguments and the paginate_links – can these work together?
- Custom post type archive page pagination
- Unable to get paginate_links working with a custom query [duplicate]
- Sort orders by custom order meta – Woocommerce Orders admin page
- How to contribute to WordPress Core using Tortoise SVN?
- How to modify core when there is no hook?
- How to make this change without changing the core? [duplicate]
- WordPress auto generates small medium and large of an image on upload, how can we guess their links?
- Why category.php throw 404 in wordpress while calling paginate_links()?
- How do you paginate a query grouped by month?
- StoreFront product pages: Turn the Short Description section into a kindred tab section [closed]
- get_next_posts_link not working without parameter max_num_pages
- Duplicate posts in paginated results
- Invalid previous pagination links generated from paginate_links()
- Pretty urls for custom pagination
- Create highly customized submenu (possibly using wp_list_pages)
- Removing subcategories from permalinks [duplicate]
- paginate_links() don’t properly work in search.php?
- Limiting number of visible links displayed with wp_link_pages
- How to modify files inside wp-includes directory in wordpress
- Safely editing core files
- search with pagination not working as expected
- Pagination Not Working on `WP_Query` Archive Page
- Why There Is No “get content by ID” Function
- Make changes of wp-db.php file persistent against updates
- Replace core wordpress file with my own
- Include a leading zero in pagination
- How can I reference external attachments without breaking core WordPress files?
- Pagination Links showing incorrect previous page number
- Pagination using paginate_links
- Later blog post pages give 404 error
- Paginate Links – Mid Size Less Than 2
- paginate_links() Change the order of links
- Where should I copy a PHP file from wp-includes to, in order to override it in my child theme?
- Pagination on WP_User_Query not updating current page
- Automatically adding a link to the next page link before ” tag in posts?
- How to add pagination to category templates
- On click some element i want to use some template
- How can I insert code into the pluggable.php file without it getting deleted after a wordpress update
- How to Show Next-Previous Link Only
- How to remove the ManageBlocksMenuItem in the ToolsMoreMenuGroup in the Gutenberg Editor?
- Archive page for WordPress Custom Post Type doesn’t show pagination from paginate_links()
- Pagination contents not changing in Front page WordPress
- How to add pagination in Terms
- Error while localizing communityEventsData in script-loader.php
- Broken pagination links on WP 4.9.10 blog pages
- How to add post page pagination to template part?
- 404 page not found on pagination in home page while navigating to next page
- I want to create pagination for my custom post type archive that i am displaying with loop
- Paginate nested query of child posts
- Extra pagination pages being wrongly generated
- Object Cache – Avoid db queries totally
- disable WP_error: authentication_failed
- Paginating custom posts in categories yields a 404 error
- WordPress 404 pagination (/page/2) error?
- Paginating custom query on category template
- WordPress Pagination Not Working After Transfer from Localhost
- Add Custom Pagination Permalink
- How to change page location in WordPress
- Paginate Links not working
- Why is my pagination showing up?
- Pagination not working for archive
- Default pagination in Home/Front page
- wp_link_pages return value even when is condition inside if statement
- error with $query->have_posts()
- Pagination only working on index page not on a template page
- Override WordPress Core File?
- Pagination only showed when no category is set in wp_query