Skip to content

Instantly share code, notes, and snippets.

@nayemDevs
Last active December 4, 2023 15:46
Show Gist options
  • Save nayemDevs/9d3d3f1bc05eb2e5e8543fb4d6c5b6cd to your computer and use it in GitHub Desktop.
Save nayemDevs/9d3d3f1bc05eb2e5e8543fb4d6c5b6cd to your computer and use it in GitHub Desktop.
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';
}
}
@djethales
Copy link

if i want to add more than one item to the menu how can i do it?

Duplicate the code that creates the menu and custimize it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment