Skip to content

Instantly share code, notes, and snippets.

@sabbir1991
Last active November 29, 2017 11:29
Show Gist options
  • Save sabbir1991/6ee7becd2fc852932a78 to your computer and use it in GitHub Desktop.
Save sabbir1991/6ee7becd2fc852932a78 to your computer and use it in GitHub Desktop.
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