Created
June 11, 2019 03:37
-
-
Save KaineLabs/3247b70bab5c79b2344e7e57ec21cbf8 to your computer and use it in GitHub Desktop.
Allow Only Verified Users To Add/Edit Reviews
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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