WordPress.org

Ready to get started?Download WordPress

Forums

Comment posting via the API (2 posts)

  1. Steve
    Member
    Posted 3 years ago #

    I've got a plugin which is bringing in comments from an external source.

    It builds up the structure as follows:

    $data = array(
    	'comment_post_ID' => $comdata_row->wp_post_id,
    	'comment_author' => $fbuserinfo[0]['name'],
    	'comment_author_email' => $commemail,
    	'comment_author_url' => $fbuserinfo[0]['profile_url'],
    	'comment_content' => $comment['text'],
    	'comment_author_IP' => '127.0.0.1',
    	'comment_date' => $time,
    	'comment_date_gmt' => $time,
    	'comment_approved' => $comment_approve,
    );

    and then does:

    wp_new_comment($data);

    The problem is that several Anti-spam captchas fire when this happens and of course as there is no interaction and the comment is lost.

    So how do I post a comment using the WP functions that won't make anti-spam plugsin fire?

  2. Steve
    Member
    Posted 3 years ago #

    Should I just change the wp_new_comment call to wp_insert_comment ?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.