Skip to content

Instantly share code, notes, and snippets.

@benmay
Created September 15, 2012 09:14
Show Gist options
  • Save benmay/3727070 to your computer and use it in GitHub Desktop.
Save benmay/3727070 to your computer and use it in GitHub Desktop.
Never Moderate WordPress user if custom user meta is set
// 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