Skip to content

Commit

Permalink
customizable comment_type und comment_approved
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pfefferle committed Feb 21, 2014
1 parent d5e9144 commit bc5a688
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions webmention.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit bc5a688

Please sign in to comment.