add_action('mvx_init', 'after_mvx_init');
function after_mvx_init() {
// add custom endpoint
add_filter('mvx_endpoints_query_vars', 'add_mvx_endpoints_query_vars');
// add custom menu to vendor dashboard
add_filter('mvx_vendor_dashboard_nav', 'add_tab_to_vendor_dashboard');
// display content of custom endpoint
add_action('mvx_vendor_dashboard_custom-mvx-menu_endpoint', 'custom_menu_endpoint_content');
}
function add_mvx_endpoints_query_vars($endpoints) {
$endpoints['custom-mvx-menu'] = array(
'label' => __('Custom Menu', 'multivendorx'),
'endpoint' => get_mvx_vendor_settings('mvx_custom_endpoint', 'seller_dashboard', 'custom-mvx-menu')
);
return $endpoints;
}
function add_tab_to_vendor_dashboard($nav) {
$nav['custom_mvx_menu'] = array(
'label' => __('Custom Menu', 'multivendorx'), // menu label
'url' => mvx_get_vendor_dashboard_endpoint_url( get_mvx_vendor_settings( 'mvx_custom_endpoint', 'seller_dashboard', 'custom-mvx-menu' ) ), // menu url
'capability' => true, // capability if any
'position' => 75, // position of the menu
'submenu' => array(), // submenu if any
'link_target' => '_self',
'nav_icon' => 'dashicons', // menu icon
);
return $nav;
}
function custom_menu_endpoint_content() {
echo '<div class="mvx_form1">';
echo '<p>Custom Menu content</p>';
echo '</div>';
}
Hold on! Effortless Integration is here!
Transform your WordPress site into a seamless multivendor platform with MultiVendorX. Get a 15-minute free consultation today!






