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.x
Multi-store. Franchise. Facilitator. AI tools.
Everything your marketplace needs - now in one platform.
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

-
DAYS
-
HOURS
-
MINUTES
-
SECONDS
20% Off Is Temporary. The Benefits Aren't.

HAPPY20

Join the MultiVendorX Facebook Community

Contact, share, and grow with thousands of MultiVendorX users around the world.
View Categories

Add Custom Menu to Store Dashboard

Table of Contents

We have added support for extending the Store Dashboard menu and loading custom React dashboard components.
Add Custom Store Dashboard Menu

Use the dashboard_other_endpoints filter to register custom dashboard menus/submenus.
Example:

add_filter(
    'dashboard_other_endpoints',
    array( $this, 'add_menu_in_dashboard' ),
    20
);

public function add_menu_in_dashboard( $submenus ) {

    $new_item = array(
        'appointment' => array(
            'name'       => __( 'Appointment', 'multivendorx-pro' ),
            'slug'       => 'appointment',
            'icon'       => 'appointments',
            'submenu'    => array(
                array(
                    'key'        => 'all-appointment',
                    'name'       => __( 'All Appointment', 'multivendorx-pro' ),
                    'slug'       => 'all-appointment',
                    'capability' => array( 'manage_store_settings' ),
                ),
                array(
                    'key'        => 'add-appointment',
                    'name'       => __( 'Add Appointment', 'multivendorx-pro' ),
                    'slug'       => 'add-appointment',
                    'capability' => array( 'manage_store_settings' ),
                ),
            ),
            'capability' => array( 'manage_store_settings' ),
            'module'     => array( 'appointment' ),
        ),
    );

    return array_merge( $submenus, $new_item );
}

Load Custom React Dashboard Component
Dashboard components can be loaded using the multivendorx_pro_dashboard_component filter.
Internal loader:

return applyFilters(
    'multivendorx_pro_dashboard_component',
    null,
    convertedKey
);

Register Custom Dashboard Component

import { addFilter } from '@wordpress/hooks';
import AppointmentDashboard from './AppointmentDashboard';

addFilter(
'multivendorx_pro_dashboard_component',
'my-plugin/appointment-dashboard',
(component, endpoint) => {

if (endpoint === 'appointment') {
return <AppointmentDashboard />;
}

return component;
}
);

Example React Component

import React from 'react';

const AppointmentDashboard = () => {
    return (
        <div className="appointment-dashboard">
            <h2>Appointment Dashboard</h2>

            <p>
                This is a custom dashboard component loaded using
                the multivendorx_pro_dashboard_component filter.
            </p>
        </div>
    );
};

export default AppointmentDashboard;

Leave a Reply

Shopping Cart
Launch Your Marketplace
in Days, Not Month
Get expert guidance to build, scale, and grow your MultiVendorX marketplace
Book Free Strategy Call
Trusted by 10000+ marketplace Owners
Scroll to Top