Ben,
I think I figured it out. The basic approach is copying how the product-edit.php file is set up. The solution requires editing a core file (class-wcvendors-pro-dashboard.php) as well as creating a new file in a core directory. This is what seems to be working for me:
1. create a new file in the same directory as product-edit.php (mine is called settings-location.php) and put your custom page code in it
2. edit class-wcvendors-pro-dashboard.php with the part between the comment lines (the first part is just shown for context)
// if action is set send to edit page with or without object_id else list type
if ('edit' == $action ) {
wc_get_template( $object.'-'.$action.'.php',
array(
'action' => $action,
'object_id' => $object_id
),
'wc-vendors/dashboard/', $this->base_dir . '/templates/dashboard/' );
/**********************************************************************/
}
// this is to get the nav menu to show up on each location page
elseif ('location' == $action ) { // "location" is used because the custom page is at url /dashboard/settings/location/123 for example
wc_get_template( 'settings-location.php',
array(
'action' => $action,
'object_id' => $object_id
),
'wc-vendors/dashboard/', $this->base_dir . '/templates/dashboard/' );
/**********************************************************************/
3. edit class-wcvendors-pro-dashboard.php again, this time with the part between the comment lines (the first part is again just shown for context)
public function get_dashboard_pages() {
$this->dashboard_pages[ 'product' ] = array(
'slug' => 'product',
'label' => __('Products', 'wcvendors-pro' ),
'actions' => array(
'edit' => __('Edit', 'wcvendors-pro' ),
'delete' => __('Delete', 'wcvendors-pro' )
)
);
$this->dashboard_pages[ 'order' ] = array(
'slug' => 'order',
'label' => __('Orders', 'wcvendors-pro' ),
'actions' => array()
);
$this->dashboard_pages[ 'settings' ] = array(
/********************************************************************/
'slug' => 'settings',
'label' => __('Settings', 'wcvendors-pro' ),
//this is to get the nav menu to show up on each location page
//'actions' => array( )
'actions' => array(
'location' => __('Location', 'wcvendors-pro' )
)
/********************************************************************/
I think that’s it. Overall, not very straightforward, but not a huge tear up either.