Claim your freedom to choose the perfect partner for your multi-vendor journey.

FREEDOM25

Celebrate the festive season by giving your marketplace a powerful lift!

FESTIVE20

5.0.0
Something big is coming for marketplace admins… MultiVendorX 5.0 is almost here. Are you ready?
Be the first to explore all the game-changing features!
Power your marketplace dreams with unbeatable Black Friday deals!

MVXBLACK30

Supercharge your marketplace vision with unstoppable Cyber Monday deals!

MVXCYBER30

Holiday cheer, bigger savings
Take 25% off-because your marketplace deserves a gift too.

happyholiday

View Categories

Add Custom Menu to Vendor Dashboard

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>';
}

Leave a Reply

Shopping Cart
Scroll to Top