Skip to content

Instantly share code, notes, and snippets.

@nayemDevs nayemDevs/new-menu.php
Last active Sep 14, 2019

Embed
What would you like to do?
Adding extra dashboard menu for Vendor Dashboard ( this code need to be inserted on your theme's functions.php)
<?php
//copy from below line
add_filter( 'dokan_query_var_filter', 'dokan_load_document_menu' );
function dokan_load_document_menu( $query_vars ) {
$query_vars['help'] = 'help';
return $query_vars;
}
add_filter( 'dokan_get_dashboard_nav', 'dokan_add_help_menu' );
function dokan_add_help_menu( $urls ) {
$urls['help'] = array(
'title' => __( 'Help', 'dokan'),
'icon' => '<i class="fa fa-user"></i>',
'url' => dokan_get_navigation_url( 'help' ),
'pos' => 51
);
return $urls;
}
add_action( 'dokan_load_custom_template', 'dokan_load_template' );
function dokan_load_template( $query_vars ) {
if ( isset( $query_vars['help'] ) ) {
require_once dirname( __FILE__ ). '/help.php';
}
}
@Kpk1l

This comment has been minimized.

Copy link

Kpk1l commented Sep 4, 2019

Hi. And if I want to add a new menu with submenu how do I do it?

@nayemDevs

This comment has been minimized.

Copy link
Owner Author

nayemDevs commented Sep 5, 2019

You can only add sub-menu under the settings panel as like Payment, shipping. In that case, you have to use $sub_settings variable and a different hook which you can find in your dokan template-tags.php file.

@Kpk1l

This comment has been minimized.

Copy link

Kpk1l commented Sep 5, 2019

Ok. That's not so good...Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.