getherbert / herbert

The WordPress Plugin Framework:
http://getherbert.com/
632 stars 94 forks source link

Skip WP insert/edit pages except listing for custom post type #131

Open moazam1 opened 8 years ago

moazam1 commented 8 years ago

I have created a custom post type. I have also created custom pages for insert/edit post. Now I want to list entries from my custom post. Instead of reinventing wheels I would like to use default WP layout for displaying a list. i.e. http://domain.com/wp-admin/admin.php?page=customposttype

The above URL works only IF I set 'show_ui' => TRUE option in custom register_post_type. I do not want to display my custom post type in menu because I have already created a panel for it.

My question is is there anyway I can use WP default listing for my custom post type? If it's not possible then is there anyone who have already done similar work and would like to share their code? I would like to save some development time.

Cheers

jeremyzahner commented 8 years ago

@moazam1 Since there is a best practice way of adding custom post types to the backend, there mostly is no need for creating your own panels for it. Because of that you will most likely not find many valuable solutions, since most people just use (and should use) the native wordpress way to do it. Maybe i could help you with it if you could provide some more code on how you are implementing your own page (or how you intend to).

moazam1 commented 8 years ago

Thanks Jeremy for the reply. I always prefer to use native WP interface for creating posts but this is a different situation. I am populating all fields from an API using AJAX and the client want to see results before they create a post. I considered Types, ACF plugins but they didn't work in my case so I end up creating a custom interface for creating/editing posts.