Pagination in plugin’s backend

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