Skip to content

Instantly share code, notes, and snippets.

@MarkKevin08
Last active March 11, 2021 05:27
Show Gist options
  • Save MarkKevin08/1362912b34ea5e847ccd35b8f80f266c to your computer and use it in GitHub Desktop.
Save MarkKevin08/1362912b34ea5e847ccd35b8f80f266c to your computer and use it in GitHub Desktop.
Change sold by link
add_filter( 'wcv_sold_by_link', 'vendor_shop_url_update', 11, 2 );
function vendor_shop_url_update( $sold_by, $vendor_id ) {
// Recreate the link and anchor text.
if ( WCV_Vendors::is_vendor( $vendor_id ) ) {
$class = isset( $css_class ) ? 'class="' . $css_class . '"' : '';
$sold_by_label = WCV_Vendors::get_vendor_sold_by( $vendor_id );
// Change the link here.
$shop_page_url = WCV_Vendors::get_vendor_shop_page( $vendor_id );
$sold_by = sprintf( '<a href="%s" %s>%s</a>', $shop_page_url, $class, $sold_by_label );
}
return $sold_by;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment