Skip to content

Instantly share code, notes, and snippets.

@max-kk
Last active February 8, 2017 13:47
Show Gist options
  • Save max-kk/fe81b7d7bd01dd351e472fd0207541e1 to your computer and use it in GitHub Desktop.
Save max-kk/fe81b7d7bd01dd351e472fd0207541e1 to your computer and use it in GitHub Desktop.
>> WP Foto Vote <<How can I allow for users to vote as many times as they wish for any photos?
<?php
/**
>> WP Foto Vote <<How can I allow for users to vote as many times as they wish for any photos?
Add it to your theme functions.php for example.
#### Note: you must have option Fast Voting (Photo Contest => Settings => Voting) disabled. ####
*/
// Allow for all
// Note: You can use just one of this lines for disable one of checks.
add_filter('fv/vote/need_check_ip_query', '__return_false', 10, 1); // Disalbe IP check
add_filter('fv_vote_check_cookies', '__return_false', 10, 1); // Disalbe Cookies check
#################################################################
// Allow for user with specified Capabilities
// https://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table
add_filter('fv/vote/need_check_ip_query', 'filter_fv_vote_not_need_check_ip_and_cookies', 10, 1);
add_filter('fv_vote_check_cookies', 'filter_fv_vote_not_need_check_ip_and_cookies', 10, 1);
function filter_fv_vote_not_need_check_ip_and_cookies() {
// disable for Administrator
if ( current_user_can('manage_options') ) {
return false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment