This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Dokan Vendor Biography Shortcode | |
*/ | |
add_shortcode( 'dokan_vendor_bio', 'dokan_vendor_bio_shortcode' ); | |
function dokan_vendor_bio_shortcode() { | |
$vendor = dokan()->vendor->get( get_query_var( 'author' ) ); | |
$store_info = $vendor->get_shop_info(); | |
if ( empty( $store_info['vendor_biography'] ) ) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Show sold by on single product page made with Elementor | |
* Add the shortcode [dokan_vendor_name] through a short-code widget on single product page | |
*/ | |
add_shortcode( 'dokan_vendor_name', 'dokan_store_name_shortcode' ); | |
function dokan_store_name_shortcode() { | |
$seller = get_post_field( 'post_author' ); | |
$author = get_user_by( 'id', $seller ); | |
$vendor = dokan()->vendor->get( $seller ); |