How to check if `comment_meta` exists before inserting the comment?

First off, you need to fix the comment_meta value. It should be an array of meta key and value pairs, and not just the meta value. So give the meta a key (or name), e.g. message_id, and then do something like so: ‘comment_meta’ => array( ‘message_id’ => preg_replace(‘~[<]~’,”,strstr($mail[‘header’]->message_id, ‘@’,true)), ), Now to check if a … Read more

Changing the Comment Fields using Filter (without success)

Your code has 2 major issues: It’s missing a return $fields; or a return value — Filter callbacks must always return something, which is normally the first parameter after it’s filtered (regardless it’s actually modified or not by your callback). Do not call comment_form() because comment_form_fields is fired in that function, hence you’ll run into … Read more