Display User Type in Product Details Page woocommerce

function ts_add_text_short_descr($description){
global $authordata;

    $author_roles = $authordata->roles;
    $author_role = array_shift($author_roles);
    $st_text="<h1 Sold By: >";
    return $description.$st_text.$author_role.$cl_text;

By using the above code I am able to display author user type in a product details page. Its a multi-vendor site. It has a user type says “Whole-seller”. When a user that particular user type adds a product I would like to display a text like Sold By: Whole-seller. But that text shouldn’t be shown when any other user type adds any product. Kindly help. Thanks in advance

, Abir 3 years 2020-07-16T08:11:33-05:00 0 Answers 52 views 0

Leave an answer