Skip to content

Instantly share code, notes, and snippets.

@miklb
Last active December 13, 2017 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miklb/a5eb292ca1df56b1cc4f4bccee923e4d to your computer and use it in GitHub Desktop.
Save miklb/a5eb292ca1df56b1cc4f4bccee923e4d to your computer and use it in GitHub Desktop.
/**
* Unspam Webmentions
*
* @method unspam_webmentions
* @param [type] $approved [description].
* @param [type] $commentdata [description].
* @return [type] [description]
*/
function unspam_webmentions( $approved, $commentdata ) {
return $commentdata['comment_type'] === 'webmention' ? 1 : $approved;
}
add_filter( 'pre_comment_approved', 'unspam_webmentions', '99', 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment