Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add extra menu in Settings menu in Dokan Dashboard
/** Adding Settings extra menu in Settings tabs Dahsboard */
add_filter( 'dokan_get_dashboard_settings_nav', 'dokan_add_settings_menu' );
function dokan_add_settings_menu( $settings_tab ) {
$settings_tab['nayem'] = array(
'title' => __( 'Nayem', 'dokan'),
'icon' => '<i class="fa fa-user"></i>',
'url' => dokan_get_navigation_url( 'settings/nayem' ),
'pos' => 32
);
return $settings_tab;
}
add_filter( 'dokan_dashboard_settings_heading_title', 'dokan_load_settings_header', 11, 2 );
function dokan_load_settings_header( $header, $query_vars ) {
if ( $query_vars == 'nayem' ) {
$header = __( 'Nayem Profiles', 'dokan' );
}
return $header;
}
add_filter( 'dokan_dashboard_settings_helper_text', 'load_helper', 10, 2 );
function load_helper( $helper_txt, $query_var ) {
if ( $query_var == 'nayem' ) {
$helper_txt = 'Nayem is a good boy';
}
return $helper_txt;
}
add_action( 'dokan_render_settings_content', 'dokan_render_settings_content', 10 );
function dokan_render_settings_content( $query_vars ) {
if ( isset( $query_vars['settings'] ) && $query_vars['settings'] == 'nayem' ) {
?>
<form action="">
<label for="">Text</label>
<input type="text">
</form>
<?php
}
}
@wankhedeamol20

This comment has been minimized.

Copy link

commented Jun 8, 2017

Hi,
Thanks for this post, it's really helpful for me.
I have one question, How to save this form data.

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.