trash_post_comments

trash_post_comments

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: wordpress-6.7.1

do_action('trash_post_comments') is found 1 times:

  • /wp-includes/post.php line 4086
    	 * @since 2.9.0
    	 *
    	 * @param int $post_id Post ID.
    	 */
    	do_action( 'trash_post_comments', $post_id );
    
    	$comments = $wpdb->get_results( $wpdb->prepare( "SELECT comment_ID, comment_approved FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ) );
    
    	if ( ! $comments ) {
    		return;
    	}