0
<?php
function wpturbo_dokan_vendor_bio_shortcode( $atts, $content = null ) {
$atts = shortcode_atts( array(
'store_id' => '',
), $atts );
// Make sure the Dokan plugin is active
if ( ! class_exists( 'WeDevs_Dokan' ) ) {
return esc_html__( 'Dokan plugin is not active.', 'wpturbo' );
}
// Get vendor information
$vendor_info = dokan()->vendor->get( absint( $atts['store_id'] ) );
if ( ! $vendor_info ) {
return esc_html__( 'Vendor does not exist.', 'wpturbo' );
}
// Get the vendor bio
$vendor_bio = $vendor_info->get_bio();
// Sanitize vendor bio
$vendor_bio = wp_kses_post( $vendor_bio );
// Return the vendor bio
return '<div class="dokan-vendor-bio">' . $vendor_bio . '</div>';
}
add_shortcode( 'dokan_vendor_bio', 'wpturbo_dokan_vendor_bio_shortcode' );
dokan vendor biography shortcode