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
<?php
/** 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 Valo chele';
}
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
}
}
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.