1. Home
  2. Docs
  3. Dokan Multi Vendor Documentation
  4. Developer Documentation
  5. Adding or Removing URL’s in Dokan Dashboard

Adding or Removing URL’s in Dokan Dashboard

If you want to insert a new URL or page to your Dokan frontend dashboard, here some sample codes that does it.

Add the following codes in your theme's function.php page.

Inserting New URL's

/**
 * Insert new URL's to the dashboard navigation bar
 *
 * @param  array  $urls 
 *
 * @return array  
 */
function prefix_dokan_add_seller_nav( $urls ) {
    
    $urls['help'] = array(
        'title' => __( 'Help Files', 'dokan'),
        'icon'  => '<i class="fa fa-users"></i>',
        'url'   => 'http://www.help.com'
    );

    $urls['google'] = array(
        'title' => __( 'Google', 'dokan'),
        'icon'  => '<i class="fa fa-google-plus"></i>',
        'url'   => 'http://www.google.com'
    );

    return $urls;
}

add_filter( 'dokan_get_dashboard_nav', 'prefix_dokan_add_seller_nav' );

Removing Existing URL

Here we are removing the “Reviews” page from the left sidebar.

/**
 * Unset an item from the menu
 *
 * @param  array  $urls
 *
 * @return array  
 */
function prefix_dokan_add_seller_nav( $urls ) {
     
    unset( $urls['reviews'] );
 
    return $urls;
}
 
add_filter( 'dokan_get_dashboard_nav', 'prefix_dokan_add_seller_nav' );

Modifying Existing URL

Lets say you want to change the name “Products” to “Items“.

/**
 * Renames an Item title
 *
 * @param  array  $urls 
 *
 * @return array  
 */
function prefix_dokan_add_seller_nav( $urls ) {
    
    $urls['products']['title'] = 'Items';

    return $urls;
}

add_filter( 'dokan_get_dashboard_nav', 'prefix_dokan_add_seller_nav' );

Was this article helpful to you?

How can we help?