Skip to content

Instantly share code, notes, and snippets.

@nayemDevs
Last active January 31, 2019 20:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nayemDevs/62d2ea32885c6ba5e70e13b4dd5fdd30 to your computer and use it in GitHub Desktop.
Save nayemDevs/62d2ea32885c6ba5e70e13b4dd5fdd30 to your computer and use it in GitHub Desktop.
Add a new seller dashboard menu
<?php
add_filter( 'dokan_query_var_filter', 'dokan_load_document_menu' );
function dokan_load_document_menu( $query_vars ) {
$query_vars['document'] = 'document';
return $query_vars;
}
add_filter( 'dokan_get_dashboard_nav', 'dokan_add_document_menu' );
function dokan_add_document_menu( $urls ) {
$urls['document'] = array(
'title' => __( 'document', 'dokan'),
'icon' => '<i class="fa fa-user"></i>',
'url' => dokan_get_navigation_url( 'document' ),
'pos' => 51
);
return $urls;
}
add_action( 'dokan_load_custom_template', 'dokan_load_template' );
function dokan_load_template( $query_vars ) {
if ( isset( $query_vars['document'] ) ) {
require_once dirname( __FILE__ ). '/document.php';
exit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment