Created
February 29, 2020 21:54
-
-
Save iconicwp/09abab81f2520ba78ecc46946f0d4367 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
add_filter( 'jck_sfr_votes_limit', 'jck_sfr_votes_limit', 10, 2 ); | |
/** | |
* Limit votes by role. | |
* | |
* @param int $limit | |
* @param JCK_SFR_User $user_votes | |
* | |
* @return int | |
*/ | |
function jck_sfr_votes_limit( $limit, $user_votes ) { | |
$user = wp_get_current_user(); | |
if ( in_array( 'author', (array) $user->roles, true ) ) { | |
return 2; | |
} | |
return $limit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment