get_comments
-
Getting comments of a certain post type
Whilst looking for a method to get comments from one of my post types in WordPress I stumbled across some undocumented parameters for the get_comments function. Simply state the name of the post type in the undocumented post_type parameter: $comments = get_comments( array( ‘number’ => 5, ‘status’ => ‘approve’, ‘post_status’ => ‘publish’, ‘post_type’ => ‘product’…