Multiple custom post types in Dashboard

This topic contains 2 reply and 2 voices, and was last updated by Gar 11 years, 5 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
August 2, 2013 at 2:21 pm 6595
Gar Hey again, I read through the documentation but I haven't seen anything about being able to add multiple custom post types in the same dashboard. As it is now, I'm using:
[wpuf_dashboard]
[wpuf_dashboard post_type="reviews"]
This displays both post types I'd like, but it repeats information such as "Gar's Dashboard" and the author bio field. Having both on separate pages isn't as intuitive as I'd like it. I'd like to use this tutorial to display which section a post belongs to (either "Posts" or "Reviews"): http://docs.wedevs.com/adding-columns-to-dashboard-table/ Is this possible -- and if not, would this be a feature that could be added to the core?
August 2, 2013 at 3:00 pm 6598
Tareq Hasan Tareq Hasan

You could use filter like this to achieve this.

August 2, 2013 at 3:55 pm 6600
Gar Gar

Perfect, thank you!

For those that want to know: I used the tutorial in my post above to add a new column in the Dashboard. To display which type of post the user submitted, I added a “Hidden Field” to my forms and used these values:

Meta Key: type_of_post
Meta Value: Review

Repeated the same for my other custom post types, changing only the Meta Value and leaving the key the same.

Use this to display the type of post in your dashboard:

echo get_post_meta( $post->ID, 'type_of_post', true );

Viewing 2 Posts - 1 through 2 (of 2 total)