Skip to content

Instantly share code, notes, and snippets.

View nayemDevs's full-sized avatar

Md. Nazmul Hassan nayemDevs

View GitHub Profile
@nayemDevs
nayemDevs / Redirect seller after registration : Dokan
Created June 22, 2016 09:21
You can replace the location "settings/store" to your own location like as dokan_get_navigation_url( 'dashboard' );
add_filter('woocommerce_registration_redirect', 'ps_wc_registration_redirect');
function ps_wc_registration_redirect( $redirect_to ) {
if ( is_user_logged_in() ){
$current_user = wp_get_current_user();
if( $current_user->roles[0] == 'seller' ) {
$redirect_to = dokan_get_navigation_url( 'settings/store' );
return $redirect_to;
}
}
return $redirect_to;
add_filter( 'dokan_store_list_args', 'change_store_list_thumb_size' );
function change_store_list_thumb_size( $args ) {
$args['image_size'] = 'full';
return $args;
}
@nayemDevs
nayemDevs / thumbnail of store listing page
Created July 21, 2016 02:01
Image thumbnail on store-list page
<?php
// Change store thumb size in store listing page
add_filter( 'dokan_store_list_args', 'change_store_list_thumb_size' );
function change_store_list_thumb_size( $args ) {
$args['image_size'] = 'full';
return $args;
function wpufe_update_post_geo1( $post_id ) {
function gmw_update_post_type_post_location( $post_id ) {
// Return if it's a post revision
if ( false !== wp_is_post_revision( $post_id ) )
return;
// check autosave //
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
@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;
}
@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 / 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 / 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 / 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 / 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();