nonce = hash('md5', ABSPATH); add_filter('init', array($this, 'verify_spam')); add_filter('comment_form_fields', array($this, 'add_real_comment_field')); add_filter('print_footer_scripts', array($this, 'javascript')); return true; } public static function get_instance() { if (null === self::$instance) { self::$instance = new self(); } return self::$instance; } public function add_real_comment_field($comment_fields) { $real_field = str_replace('comment', $this->nonce, $comment_fields['comment']); $comment_fields['comment'] = $comment_fields['comment'] . $real_field; return $comment_fields; } public function javascript() { wp_enqueue_script('jquery'); ?> nonce]); $_POST['comment'] = $comment_content; } return $commentdata; } } Antispam::get_instance();