Answer the question
In order to leave comments, you need to log in
How to properly add feedback fields to the WP admin using wp_insert_comment?
There wp_insert_comment()
is an array in the documentation
$data = [
'comment_post_ID' => 1,
'comment_author' => 'admin',
'comment_author_email' => '[email protected]',
'comment_author_url' => 'http://',
'comment_content' => 'content here',
'comment_type' => 'comment',
'comment_parent' => 0,
'user_id' => 1,
'comment_author_IP' => '127.0.0.1',
'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)',
'comment_date' => null, // получим current_time('mysql')
'comment_approved' => 1,
];
'comment_content' =>
suitable for a comment, and so on...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question