281 | | $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) ); |
| 281 | $post_types_to_delete = array( 'attachment', 'revision' ); |
| 282 | foreach ( get_post_types() as $post_type ) { |
| 283 | if ( post_type_supports( $post_type, 'author' ) |
| 284 | $post_types_to_delete[] = $post_type; |
| 285 | } |
| 286 | $post_types_to_delete = implode( "', '", $post_types_to_delete ); |
| 287 | $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d AND post_type IN ('$post_types_to_delete')", $id) ); |