[英]Wordpress not showing comments in admin
在此Wordpress安裝中,管理部分未顯示注釋。 我使用wp_insert_comment()函數添加注釋,並使用來自自定義帖子類型的帖子ID。 在自定義帖子類型中,支持設置為接受評論。
在自定義帖子類型編輯頁面上,我看到了評論的計數氣球(請參見屏幕截圖1),當我單擊氣球時,我進入了管理員的評論頁面,並完美地看到了該頁面的評論(屏幕截圖2) 。 但是,當我直接進入評論部分時,它說沒有評論(屏幕截圖3)。 注釋按鈕上的計數也起作用。(屏幕截圖4)
我嘗試修改注釋代碼,但仍然無法正常工作。
編碼我如何添加評論:
$data = array(
'comment_post_ID' => HERE COMES THE ID FROM THE POST (CUSTOM POST TYPE),
'comment_author' => HERE COMES THE AUTHOR NAME,
'comment_author_email' => HERE COMES AUTHOR EMAIL,
'comment_author_url' => '',
'comment_content' => get_the_title($id).' heeft sollicitatie gedaan op '. $time,
'comment_type' => '',
'comment_parent' => '',
'comment_author_IP' => $_SERVER['REMOTE_ADDR'],
'comment_agent' => '',
'comment_date' => $time
);
$comment_id = wp_insert_comment($data);
wp_set_comment_status( $comment_id, 'hold' );
我發現了問題。 我更改了WPML設置,它開始工作了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.