Skip to content

Instantly share code, notes, and snippets.

View nayemDevs's full-sized avatar

Md. Nazmul Hassan nayemDevs

View GitHub Profile
@nayemDevs
nayemDevs / new-menu.php
Last active December 4, 2023 15:46
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;
}
/*MIME TYPE*/
function wpufe_custom_upload_extensions( $extensions ) {
$extensions['custom'] = array(
'label' => __( 'Custom Extensions', 'wpuf' ),
'ext' => 'eps,ai',
);
return $extensions;
}
@nayemDevs
nayemDevs / Dashboard menu
Last active January 31, 2019 20:18
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 ) {
@nayemDevs
nayemDevs / Category loader
Created January 24, 2017 04:35
Load category in ajax
add_action( 'wp_ajax_dokan_fetch_product_child_category', 'dokan_fetch_product_child_category' );
function dokan_fetch_product_child_category() {
if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'marketica-child-theme-nonce' ) ) {
wp_send_json_error( __( 'Nonce Verfication faild', 'dokan' ) );
}
$category_id = ( isset( $_POST['category'] ) && ! empty( $_POST['category'] ) ) ? $_POST['category'] : '';
if ( empty( $category_id ) ) {
@nayemDevs
nayemDevs / functions.php
Last active March 7, 2021 09:58 — forked from sabbir1991/functions.php
Render and manage all SEO fields in admin user edit profile
<?php
add_action( 'dokan_seller_meta_fields', 'dokan_load_store_seo_field_in_admin', 10 );
add_action( 'dokan_process_seller_meta_fields', 'dokan_process_seller_seo_data', 10 );
function dokan_load_store_seo_field_in_admin( $user ) {
$seo = new Dokan_Pro_Store_Seo();
$seller_profile = dokan_get_store_info( $user->ID );
$seo_meta = isset( $seller_profile['store_seo'] ) ? $seller_profile['store_seo'] : array();
@nayemDevs
nayemDevs / flatsome fixed
Created January 19, 2017 09:18
Flatsome map issue
add_action( 'wp_enqueue_scripts', 'flatsome_child_live_search_script', 78 );
function flatsome_child_live_search_script() {
global $wp, $extensions_uri;
if ( isset( $wp->query_vars['settings'] ) && $wp->query_vars['settings'] == 'store' ) {
wp_dequeue_script( 'jquery-ui-autocomplete' );
wp_dequeue_script( 'flatsome-live-search' );
wp_dequeue_script( 'dokan-tag-it' );
@nayemDevs
nayemDevs / GeoDirectory Conflict fix
Created January 18, 2017 04:15
Conflict between Dokan and GeoDirectory plugin
function _mygd_dequeue_script() {
if(!function_exists('geodir_plugin_url')){return;}
wp_deregister_script( 'chosen' );
wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
wp_dequeue_style( 'dokan-chosen-style' );
}
add_action( 'wp_print_scripts', '_mygd_dequeue_script', 100 );
@nayemDevs
nayemDevs / dashboard color change
Created November 22, 2016 05:28
change dashboard hover, button color
.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.active,
.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li:hover,
.dokan-dashboard .dokan-dash-sidebar ul.dokan-dashboard-menu li.dokan-common-links a:hover{
background: #6abb46;
}
input[type="submit"].dokan-btn-theme, a.dokan-btn-theme, .dokan-btn-theme,
input[type="submit"].dokan-btn-theme:hover,
a.dokan-btn-theme:hover,
@nayemDevs
nayemDevs / Extra field on Registration Form
Created October 19, 2016 17:34
Extra Field For WordPress Registration
/* Showing the extra field on the registration form */
add_action('register_form', 'new_register_field');
function new_register_field() {
?>
<p>
<label for="first_name"><?php _e('First Name') ?><br />
<input type="text" name="first_name" id="first_name" class="input" value="<?php echo esc_attr($_POST['first_name']); ?>" size="25" tabindex="20" />
</label>
</p>
@nayemDevs
nayemDevs / functions.php
Created October 14, 2016 16:35 — forked from sabbir1991/functions.php
Added shop url into wp admin new user interface
// Add this actions
add_action( 'user_new_form', 'add_seller_store_field', 10 );
add_action( 'edit_user_created_user', 'add_shop_url_for_seller' , 10, 2);
// Add this filter
add_filter( 'user_profile_update_errors', 'check_fields_add_new_user', 10, 3 );
function add_shop_url_for_seller( $user_id, $notify ) {
if ( ! $user_id ) {
return;
}