Created
September 15, 2012 09:14
-
-
Save benmay/3727070 to your computer and use it in GitHub Desktop.
Never Moderate WordPress user if custom user meta is set
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
// if the user_meta 'vsc_fame' is set for a user, then their comments will ALWAYS be approved, | |
// regardless if they are failed because they contain links etc. | |
function comments_edr_hofs( $approved , $commentdata ) | |
{ | |
if( isset( $commentdata['user_ID'] ) ) | |
{ | |
if( get_the_author_meta( 'vsc_fame', $commentdata['user_ID'] ) ) | |
{ | |
return 1; | |
} | |
} | |
return $approved; | |
} | |
add_filter( 'pre_comment_approved' , 'comments_edr_hofs' , '99', 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment