Creating function for custom shortcode in wordpress and Dokan multi vendor

50 views Asked by At

I am trying to place a shortcode as a menu item in max mega menu on the vendor dashboard to display a button or series of buttons for the vendor to view their own store.

I have managed to create a sample custom shortcode which works and displays the button but I cant figure out how to write the function needed to check user is logged in and check they are a vendor.

I found the header-menu.php in themes/dokani-develop/dokan/global which has the code I need but I dont know how to apply that into what I need. ( i'm not a developer )

Any pointers would be greatly appriciated.

I understand this is what I need to use I just know how to write this in a function.

if ( is_user_logged_in() ) :

    if ( dokan_is_user_seller( $user_id ) ) :           
            
        <a href="<?php echo esc_url( dokan_get_store_url( $user_id ) ); ?>" 
target="_blank"><?php esc_html_e( 'Visit your store', 'dokani' ); ?> <i class="fas fa-external-link">
    
0

There are 0 answers