custom social and messanger fields
-
Hi,
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.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘custom social and messanger fields’ is closed to new replies.