Skip to content

Instantly share code, notes, and snippets.

@fervous
Forked from bentasm1/functions.php
Created September 3, 2016 04:22
Show Gist options
  • Save fervous/24a588465b2b356c96f967a776089b3c to your computer and use it in GitHub Desktop.
Save fervous/24a588465b2b356c96f967a776089b3c to your computer and use it in GitHub Desktop.
WC Vendors Pro - Function to output vendor ratings/feedback in side bar
// Put this in your themes function.php
function vendor_feedback_sidebar() {
if ( is_shop() ) {
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
if ( ! WCVendors_Pro::get_option( 'ratings_management_cap' ) ) echo WCVendors_Pro_Ratings_Controller::ratings_link( $vendor_id, true );
}
} // vendor_feedback_sidebar()
// call this in your side bar
<?php sidebar_vendor_ratings(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment