Created
January 28, 2022 10:59
-
-
Save J-H-Mojumder/69670aca6af0b2b19bfd27317694bd41 to your computer and use it in GitHub Desktop.
Use [dokan_vendor_dashbord] shortcode to show the "Go to Vendor Dashboard" button on any page you want when a vendor is logged in.
This file contains hidden or 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 | |
add_shortcode( 'dokan_vendor_dashbord', 'dokan_show_vendor_dashboard_url' ); | |
function dokan_show_vendor_dashboard_url() { | |
if ( ! dokan_is_user_seller( get_current_user_id() ) ) { | |
return; | |
} | |
printf( | |
'<p><a href="%s" class="dokan-btn dokan-btn-theme vendor-dashboard" >%s</a></p>', | |
esc_url( dokan_get_navigation_url() ), | |
esc_html( apply_filters( 'dokan_set_go_to_vendor_dashboard_btn_text', __( 'Go to Vendor Dashboard', 'dokan-lite' ) ) ) | |
); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment