Save and return Custom social fields
-
Hi (@ rur165),
i found your code here https://www.ads-software.com/support/topic/can-we-add-extra-social-link-in-vendor-dashboard/. And this great.I want to add a social network button viber (messanger). To add a field to my profile page I am using this code.
add_filter( 'dokan_profile_social_fields', function($fields) { $fields['viber'] = array( 'icon' => 'globe', 'title' => __( 'Viber', 'dokan-lite' ), ); return $fields; } );
But on the page I see http: //. I want to remove http: // because I want to use the Viber button on the page. I need to change type = “url” to “name”, I think so, but I’m not really sure. Because viber has its own kind of link. And number not save. Your code only requires url input.
For return button im use second code:
add_action( 'woocommerce_single_product_summary', 'seller_phone_on_single' ); function seller_phone_on_single() { global $product; $seller = get_post_field( 'post_author', $product->get_id()); $author = get_user_by( 'id', $seller ); $store_info = dokan_get_store_info( $author->ID ); ?> <span class="details"> <a href="viber://chat?number=<?php printf ($store_info['Viber']) ?>" target="_blank"><i class="fab fa-viber" aria-hidden="true" target="_blank"></i></a> </span> <?php }
Please help with the correct code.
- This topic was modified 3 years, 2 months ago by .
- This topic was modified 3 years, 2 months ago by .
- This topic was modified 3 years, 2 months ago by .
- This topic was modified 3 years, 2 months ago by .
- This topic was modified 3 years, 2 months ago by .
- This topic was modified 3 years, 2 months ago by .
- This topic was modified 3 years, 2 months ago by .
- This topic was modified 3 years, 2 months ago by .
- This topic was modified 3 years, 2 months ago by .
- The topic ‘Save and return Custom social fields’ is closed to new replies.