I have a created a custom post type called "Events" using register_post_type. I am now trying to create a submenu within "Events" that will only show events sorted by a specific meta_key and meta_value. (Example: Only show events that have been marked as "priority.")
I am using this code to create the "priority events" submenu, but the query continues to return all of my events instead of just the priority events:
function rt_priority_event_add_submenu() {
$sub_slug = 'edit.php?post_type=event&meta_key=event_priority&meta_value=true';
add_submenu_page('edit.php?post_type=event', 'Priority Events', 'Priority Events', 'manage_options', $sub_slug);
}
Here is the Events custom post type is set up:
register_post_type( 'event', array(
'label' => 'Events',
'labels' => rt_ui_labels( 'Event', 'Events', 'redtri' ),
'public' => true,
'has_archive' => true,
'rewrite' => true,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail'),
) );
I don't need any new fancy columns or anything - I just want to use the same columns already set up in Events.
Thanks in advance, and please let me know if you need more information!