• Resolved alpheus

    (@alpheus)


    I’m writing a WordPress plugin that is used to pull records from a database. These records are viewed and managed via the WordPress admin panel through a top level menu that I created. What I want to do is create pagination and search abilities of my database records through my plugin via the admin panel. I want this to look and function just like the posts in the admin panel function with the search and pagination.

    Does WordPress have a set of functions or offer documentation on how to replicate the pagination and search functions that were used on the posts screen for your plugin? Thanks!

Viewing 1 replies (of 1 total)
  • WordPress paging is designed to work with WordPress queries, if you’re querying against a custom database, or custom tables you’d need to write your own paging functions/code. It’s actually not all that hard to do, have a google for “PHP paging mysql query” or similar, as there are slightly varying approaches on how to do it.

    The most notable pieces of information are how the number of pages, offsets/limits are calculated, and how to adjust your query accordingly. Don’t worry if any guides reference specific MySQL functions like mysql_query, it’s not important, as you can still use the same logic inside your $wpdb type queries and code.

Viewing 1 replies (of 1 total)
  • The topic ‘Writing a Plugin – Have Questions’ is closed to new replies.