Skip to content

Instantly share code, notes, and snippets.

@cccaldas
Created August 20, 2012 03:27
Show Gist options
  • Save cccaldas/3400185 to your computer and use it in GitHub Desktop.
Save cccaldas/3400185 to your computer and use it in GitHub Desktop.
$data = array(
'comment_post_ID' => 40,
'comment_author' => 'admin',
'comment_author_email' => '[email protected]',
'comment_author_url' => 'http://www.catswhocode.com',
'comment_content' => 'Lorem ipsum dolor sit amet...',
'comment_author_IP' => '127.0.0.1',
'comment_agent' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; fr; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3',
'comment_date' => date('Y-m-d H:i:s'),
'comment_date_gmt' => date('Y-m-d H:i:s'),
'comment_approved' => 0,
);
$comment_id = wp_insert_comment($data);
var_dump($comment_id);
add_comment_meta($comment_id, "bairro", "Mata da Praia");
add_comment_meta($comment_id, "cep", "29.109-231");
var_dump(get_comment_meta($comment_id, "bairro", true));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment