Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@miklb
Last active January 6, 2018 21:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miklb/5f06c91eaa494bab663917099ec786e5 to your computer and use it in GitHub Desktop.
Save miklb/5f06c91eaa494bab663917099ec786e5 to your computer and use it in GitHub Desktop.
Unspam Webmentions in WordPress theme function
/**
* 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