Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Save and return Custom social fields

$
0
0

Replies: 0

Hi (@ rur165),
i found your code here https://wordpress.org/support/topic/can-we-add-extra-social-link-in-vendor-dashboard/. And this great.

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 the http://. I want to remove http:// because I want to display a Viber button on the page.

And for this function im use next 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
        
}

How i can do this option?

  • This topic was modified 2 minutes ago by cousinr.

Viewing all articles
Browse latest Browse all 59525

Trending Articles