Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/3247b70bab5c79b2344e7e57ec21cbf8 to your computer and use it in GitHub Desktop.
Save KaineLabs/3247b70bab5c79b2344e7e57ec21cbf8 to your computer and use it in GitHub Desktop.
Allow Only Verified Users To Add/Edit Reviews
<?php
/**
* Allow Only Verified Users To Add/Edit Reviews.
*/
function yzc_only_verified_users_can_add_reviews( $can ) {
if ( current_user_can( 'administrator' ) ) {
return true;
}
$can = false;
if ( yz_is_user_account_verified( bp_loggedin_user_id() ) ) {
$can = true;
}
return $can;
}
add_filter( 'yz_is_user_can_add_reviews', 'yzc_only_verified_users_can_add_reviews' );
add_filter( 'yz_is_user_can_edit_reviews', 'yzc_only_verified_users_can_add_reviews' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment