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
- Paged posts – how to use numbers and next/previous links?
- changing wp-admin/widgets.php
- Add class to before_widget from within a custom widget
- How to disable core and plugin updates
- Possible to fix admin URL behind proxy issue without hacking core?
- How to remove_query_arg() for paginate_links()
- How to share WordPress core library
- Cleaning up WordPress to improve performance?
- paginate_links() don’t properly work in search.php?
- How to update the delete user confirmation form?
- How can I modify what is being output in wp_head, whether by a theme or WordPress in general?
- Getting paginate_links() ‘end_size’ to display none
- 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?
- How to remove X-Frame-Options: SAMEORIGIN” from WordPress?
- Custom Search Page Pagination Not Working
- Pagination Not Displaying on Custom Term Archive
- Combining WordPress pagination functions for archives and search results
- 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
- Edit format of Paginate_Links()
- paginate_links() outputs extra empty pages on custom loop
- Headers already sent – WordPress core
- Changing a WordPress core function without hacking core
- Two domains on one WordPress Installation
- How can I add my script to admin using script-loader.php?
- Paginate_links won’t create the right links on a taxonomy filtered custom post type archive
- In pagination, change link for page 1 to homepage
- Can paginate_links() be customized for a specific category or tag?
- WP_QUERY loop, offset in the arguments and the paginate_links – can these work together?
- Paginate_links links not working accordingly to how I do query the page
- Custom post type archive page pagination
- What problems maybe happen if I remove “wp-” prefix from wordpress folders and files?
- How to Dequeue All WordPress Assets
- Edit admin post page
- Unable to get paginate_links working with a custom query [duplicate]
- Sort orders by custom order meta – Woocommerce Orders admin page
- How to overwrite / extent wordpress function is_email
- How to contribute to WordPress Core using Tortoise SVN?
- Customizing comments pagination for bootstrap
- 404 on term taxonomy archive pagination only with some terms
- get_the_content_feed with paginated posts
- paging in WP_Query on static page
- How to modify core when there is no hook?
- Use hooks for undo/redo admin actions?
- How to make this change without changing the core? [duplicate]
- Last page in pagination does not match max_num_pages – the overall post count is less according to pagination
- WordPress auto generates small medium and large of an image on upload, how can we guess their links?
- Should there be concern about breaking Gutenberg updates to extended core blocks?
- How to get URL for the first page of post archive
- 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
- pagination for single post by category
- Create highly customized submenu (possibly using wp_list_pages)
- Alter wp_post table vs. post_meta performance/speed
- How WordPress is able to change locale without using setlocale
- Using Ajax in the prev_posts_link and next_posts_link
- Removing subcategories from permalinks [duplicate]
- paginate_links() don’t properly work in search.php?
- Limiting number of visible links displayed with wp_link_pages
- Which core file is responsible for gravatars?
- How to: Avoid a bunch of useless Auto Draft ID entries related in posts table and disable autosave feature in ‘post-new.php’?
- 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
- Add Password Generator on password protected page
- In Custom page – next_posts_link Not working while previous_posts_link is working
- Pagination doesn’t function properly for archive of a custom post type set as the front 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
- How to properly rewrite pagination rules for a CPT to avoid 404 error on /page/2
- Include a leading zero in pagination
- How can I reference external attachments without breaking core WordPress files?
- Who updates the wp-admin/core file?