我确定缺少一些愚蠢的东西,但我很累,无法理解到底是什么。
我有一个 print_rs 很好的数组:
Array ( [0] => stdClass Object ( [comment_ID] => 20 [comment_post_ID] => 227 [comment_author] => admin [comment_author_email] => [comment_author_url] => [comment_author_IP] => ::1 [comment_date] => 2012-07-29 14:19:34 [comment_date_gmt] => 2012-07-29 14:19:34 [comment_content] => I'm attending this Event! [comment_karma] => 0 [comment_approved] => 1 [comment_agent] => [comment_type] => [comment_parent] => 0 [user_id] => 1 ) )
ps 删除了一些隐私值。
现在我想获取comment_ID,但没有任何输出到浏览器。
php 看起来像这样:
$current_user_comment = get_comments( array(
'post_id' => $post->ID,
'user_id' => get_current_user_id(),
'number' => 1,
'status' => 'approve',
'type' => 'comment'
) );
print_r ( $current_user_comment );
echo $current_user_comment->comment_ID;