In the admin back-end of a plugin, you can’t use the query_vars hook and the get_query_var built in function since the page itself is a query parameter. To get around this, I simply add a new query parameter to the end of your plugin page link called, ‘&pagenum=#” and I pull it out manually using:
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 1;
There might be a better way of doing this, but I haven’t found one that requires less effort.
Here is what the plugin url might look like:
admin.php?page=[plugin-dir]%2F[plugin-slug].php&pagenum=1
Related Posts:
- Admin Menus – Name Menu different from first Submenu [duplicate]
- add menu page in loop menu order
- How to fix the admin menu margin-top bug in WordPress 5.5?
- Modify previous and next text from pagination links
- Getting paginate_links() ‘end_size’ to display none
- WordPress AJAX Pagination with query_posts
- Remove Customize Background and Header from Appearance admin menu without CSS or JS
- How to implement WP_List_Table? WP_List_Table giving array instead of a value in listing table
- Static Frontpage Pagination – Custom loop
- I can’t fetch query parameters ($_GET parameters) with get_query_var
- renaming an admin menu item with decimal array index number
- Rewriting search and pagination base
- WooCommerce – Customer Order History Pagination
- Changing Link Attributes for Wp_Link_Pages
- Custom Loop Pagination on WordPress
- Edit format of Paginate_Links()
- Pagenavi pagination via wp-query in functions.php showing same content for each page
- How to check if comments are paginated?
- get understrap pagination to work with custom query
- How to Add a Link to the Drop-Down User Menu in the Admin Bar?
- Customized title tag for each page in pagination?
- Add “last” and “first” to WordPress Comment Pagination Links
- WordPress get pagination on wpdb get_results
- Sorting Posts | Alphabetical Order
- Getting rid of role=”navigation” in the Home Page Pagination
- Page navigation not showing even tho it should
- Create Logout Link WordPress Admin Menu
- How to get the Page Number of the Current Page in Single Post Pagination
- How can I add pagination and how can I change thumbnail size?
- Why use the Settings API over a new administration menu?
- WP-PageNavi is showing the first page only
- Adding subdomain to home_url for “add_menu_page”
- How can I properly control the numbers and dots that appear in pagination?
- Increase returned number/pages on pagination
- Adding nofollow to a PHP generated Nav
- Using loop pagination on single.php
- WordPress 3.2 query_posts and pagination, permalinks issue
- Unreadable pagination
- How to show all pages in blog navigation?
- get_terms pagination
- Add_menu_page not displaying the menu in class based plugin
- Search not showing all results
- PHP code to use on next & previouspage links
- Pagination for custom shop loop woocommerce
- Custom plugin settings link doesn’t append current class to menu item when visited? Why?
- How to get all author posts outside of author templates
- How to create pagination for users list using custom array?
- Change order of custom submenu link in WP Admin?
- Custom Pagination is Broken
- Pagination on Custom Post
- Next post link on a bootstrap button
- 2nd page displaying the exact same posts as my first page (minus the very first post)
- Prev/Next Links Broken on Static Front Page Pagination
- Rewrite with pagination /foo/page/2/ to posts of a given category, page 2
- the_posts_pagination() not working in wpquery
- how to save checkbox data for custom setting?
- ACF Repeater Pagination stopped working since upgrade to php7.2
- Admin submenu issue with PHP not detecting two strings as equal
- admin-ajax GET response bad request
- Generating rel=”prev” and rel=”next” using filters
- Need help with Code Correction php+wordpress
- Custom query vars filters problem with pagination
- Some menu items wont budge
- How to Handle Going Backwards in Navigation When Referrer in PHP/JavaScript won’t work?
- Need help with pagination
- Custom pagination (Previous / Next)
- WordPress pagination not working in search result page
- Remove Post if Advanced Custom Field is checked to fix paging
- How to add PHP pagination to wordpress
- Remove submenu item from list
- pagination broken – clicking next displays “page not found”
- Admin Menu new tab external link
- page 1 is not paged
- Pagination stays on same page for post category
- Pagination Not Working (pages duplicating content)
- Pagination in single.php
- Pagination at category doesnt work with same name of page
- How to work Woocommerce pagination inside shortcode?
- Help to modify wp_link_pages()
- How do I get pagination for get_posts() in WordPress or do I have to rewrite the whole code?
- Pagination contents not changing in Front page WordPress
- Load more posts using AJAX based on posts inside WP_Query
- How to stop hiding buttons forward / backward in pagination?
- How to make a pagination with dropdown selection?
- static page pagination not working
- Trying to get pagination working on WP_Query() post grid
- AJAX numerical pagination problem in TwentyFifteen-child theme
- Pagination 404 error(I have refreshed the permalinks and tried several previous options)
- Pagination – Previous link is not show and Next link sticks at page 2
- Top Authors list by highest post views with Ajax pagination
- How can I get my pagination loop to display the correct number of total pages?
- Following/Followers Users list Using Ajax Pagination inside Author Profile
- WordPress Single Post Pagination Numbered and Navigational
- Exclude a category slug on pagination
- Add Admin Option w/ Anonymous Function
- Add a leading zero to pagination
- Get current_post in reverse order with pagination
- Issue with search form admin panel after PHP migration
- Apply filters when loading post via ajax
- offset and max_num_pages in pagination gallery