wp_set_comment_statusの情報

WordPressで、コメント情報の承認・非承認などの情報を取得したい場合がある。


その時は


wp_set_comment_statusを利用する。具体的な利用方法は


add_action('wp_set_comment_status', 'wpsetcommentstatus');


function wpsetcommentstatus( $comment_id )

{

$status = wp_get_comment_status( $comment_id );

}


で、$statusにはapprovedなどの情報が格納されている。





コメントをどうぞ