Hello guys how are you? Welcome back to my blog therichpost.com. Guys today in this post, I will tell show you How to enable Google Business (Google My Business) as a social media link on the Dokan vendor dashboard?
Guys if you are new in WordPress or in WooCommerce then please check the below links for some good tutorials:
Here is the working steps for To enable Google Business (Google My Business) as a social media link on the Dokan vendor dashboard, you’ll need to customize Dokan, as Google Business is not included by default in the vendor social media profile options.
and please follow carefully:
Here’s how you can add Google Business as a new social media field:
✅ Step 1: Add Field to Vendor Dashboard
Use the dokan_settings_form_bottom
action hook to add the Google Business URL field.
add_action('dokan_settings_form_bottom', 'add_google_business_field_to_vendor_dashboard');
function add_google_business_field_to_vendor_dashboard($current_user) {
$store_info = dokan_get_store_info($current_user->ID);
$google_business = isset($store_info['social']['google_business']) ? esc_attr($store_info['social']['google_business']) : '';
?>
<div class="dokan-form-group">
<label class="dokan-w3 dokan-control-label" for="store_google_business">Google Business</label>
<input type="url" name="settings[social][google_business]" id="store_google_business" class="dokan-form-control" value="<?php echo $google_business; ?>" placeholder="https://business.google.com/..." />
</div>
<?php
}
✅ Step 2: Save the Field
Use the dokan_store_profile_saved
action hook to ensure it saves with the vendor profile.
add_action('dokan_store_profile_saved', 'save_google_business_field', 15, 2);
function save_google_business_field($store_id, $dokan_settings) {
if (!empty($_POST['settings']['social']['google_business'])) {
$social = $dokan_settings['social'];
$social['google_business'] = esc_url_raw($_POST['settings']['social']['google_business']);
$dokan_settings['social'] = $social;
update_user_meta($store_id, 'dokan_profile_settings', $dokan_settings);
}
}
✅ Step 3: Show Google Business Link on Store Page (Optional)
If you also want to display the Google Business link on the frontend store page:
add_action('dokan_store_profile_frame_after', 'show_google_business_link');
function show_google_business_link($store_user) {
$store_info = dokan_get_store_info($store_user->ID);
if (!empty($store_info['social']['google_business'])) {
echo '<li><a href="' . esc_url($store_info['social']['google_business']) . '" target="_blank"><i class="fa fa-map-marker"></i> Google Business</a></li>';
}
}
✅ Optional: Add an Icon (CSS or FontAwesome)
To make the link look like other social links, ensure you’re using proper FontAwesome classes or custom icons.
✅ Final Notes:
- This requires basic PHP and WordPress theme/plugin editing.
- Always test in a staging environment before deploying to live.
- You may want to move this to a custom plugin or your theme’s
functions.php
.
Would you like this in a plugin format to install directly instead?
Okay guys this is it and if you will have any query then feel free to comment below.
Ajay
Thanks