Untitled

 avatar
webwizards
plain_text
15 days ago
542 B
4
Indexable
function display_vendor_bio_shortcode() {
    global $post;
    
    if (isset($post->ID)) {
        $vendor_id = marketking()->get_product_vendor($post->ID);
    }
    if (empty($vendor_id)) {
        $vendor_id = marketking()->get_vendor_id_in_store_url();
    }
    
    if (empty($vendor_id)) {
        return '';
    }
    
    $bio = get_user_meta($vendor_id, 'description', true);
    
    return empty($bio) ? '' : '<div class="vendor-bio">' . wpautop($bio) . '</div>';
}

add_shortcode('vendor_bio', 'display_vendor_bio_shortcode');
Editor is loading...
Leave a Comment