From bc5a688c4cbdbe251076f45d7055ddba6aafbccc Mon Sep 17 00:00:00 2001 From: pfefferle Date: Fri, 21 Feb 2014 10:05:27 +0100 Subject: [PATCH] customizable comment_type und comment_approved it is now possible to set the comment_type and the comment_approved via for example the config.php ``` define('WEBMENTION_COMMENT_APPROVE', 1); define('WEBMENTION_COMMENT_TYPE', 'pingback'); ``` or via filter. thanks @snarfed for the idea --- webmention.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/webmention.php b/webmention.php index 5e046627..d2c61b64 100755 --- a/webmention.php +++ b/webmention.php @@ -162,10 +162,13 @@ public static function parse_query($wp) { $comment_author_email = ''; $comment_author_url = esc_url_raw($source); $comment_content = wp_slash($content); - // change this if your theme can't handle the webmention comment type - $comment_type = apply_filters('webmention_comment_type', 'webmention'); + // change this if your theme can't handle the WebMentions comment type + $webmention_comment_type = defined('WEBMENTION_COMMENT_TYPE') ? WEBMENTION_COMMENT_TYPE : 'webmention'; + $comment_type = apply_filters('webmention_comment_type', $webmention_comment_type); $comment_parent = null; - $comment_approved = '1'; + // change this if you want to auto approve your WebMentions + $webmention_comment_approve = defined('WEBMENTION_COMMENT_APPROVE') ? WEBMENTION_COMMENT_APPROVE : 0; + $comment_approved = apply_filters('webmention_comment_approve', $webmention_comment_approve); $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_content', 'comment_type', 'comment_parent', 'comment_approved');