最好是系统函数 而不是数据库调用
回复内容:
本¥文来源gaodai$ma#com搞$代*码*网(搞代gaodaima码
最好是系统函数 而不是数据库调用
据我所知,没有这个函数。需要自己去写。
可以在
wp-includes/comment.php
增加一个funciton
function get_first_approved_comment($post_id) { global $wpdb; return $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved = '1' ORDER BY comment_date DESC limit 1", $post_id));}