Last active
January 6, 2018 21:38
-
-
Save miklb/5f06c91eaa494bab663917099ec786e5 to your computer and use it in GitHub Desktop.
Unspam Webmentions in WordPress theme function
This file contains hidden or 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
/** | |
* 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