WordPress.org

Ready to get started?Download WordPress

Forums

How to call custom post type functions in a plugin with tabs (2 posts)

  1. Allen
    Member
    Posted 1 year ago #

    I've been able to get a custom post type working fine using a example plugin (there are many examples on the web how to do this), and I would like to take advantage of the ease of admin listing tables, adding posts, etc. However, I have a published plugin that uses tabs in the admin section, where each tab typically calls a function which renders the output (one tab for settings, one for rss feeds, etc). I have no idea if it is possible to call the functions that create the tables, etc, for a custom post type. Has anyone seen an example of how this might be done? Thanks.

  2. bcworkz
    Member
    Posted 1 year ago #

    The table generation for all post types is handled by class 'WP_Posts_List_Table' . You can see how it is used in wp-admin/edit.php, which is requested with the url parameter post_type=mycustomname . This obviously isn't a function you can call, but I imagine one could be created that uses the class to display a table, based on how the page works.

Topic Closed

This topic has been closed to new replies.

About this Topic