Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Allow Adding/Editing Reviews By Member Type.
<?php
/**
* Allow Adding/Editing Reviews By Member Type.
*/
function yzc_allow_reviews_by_member_type( $can ) {
// Get User Member Type
$member_type = bp_get_member_type( bp_loggedin_user_id() );
if ( $member_type == 'customer' ) {
return false;
}
return $can;
}
add_filter( 'yz_is_user_can_add_reviews', 'yzc_allow_reviews_by_member_type' );
add_filter( 'yz_is_user_can_edit_reviews', 'yzc_allow_reviews_by_member_type' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment