WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Writing a Plugin - Have Questions (2 posts)

  1. alpheus
    Member
    Posted 4 years ago #

    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!

  2. Mark / t31os
    Moderator
    Posted 4 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic