Open
Description
Given the following code, a WordPress.WP.PreparedSQL.NotPrepared
error is raised:
$query = $wpdb->prepare( "
SELECT ID
FROM {$wpdb->posts}
WHERE post_type = %s
", $post_type );
$all_post_ids = $wpdb->get_col( $query );
The error is raised because the prepared query is passed in via a variable instead of prepare()
being called directly inside get_col()
.
Is there a way that this format can be supported in WPCS?