Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2434 - Dynamic Metrics - Genmapper - Show Data Layers #2515

Merged
Prev Previous commit
Next Next commit
Addressed sql placeholders code smells
  • Loading branch information
kodinkat committed Jun 13, 2024
commit 1fda5033bdc80b6f4cdc712515a992fd03b3486e
4 changes: 2 additions & 2 deletions dt-metrics/records/genmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ public function package_data_layer_post_fields( $query, $post_type, $post_settin
$post_ids_array_sql = dt_array_to_sql( $post_ids, true );
$data_layer_fields_array_sql = dt_array_to_sql( $data_layer_fields );

$query = $wpdb->get_results( $wpdb->prepare( "
$query = $wpdb->get_results( "
SELECT post_id, meta_key, meta_value
FROM $wpdb->postmeta
WHERE post_id IN ($post_ids_array_sql) AND meta_key IN ($data_layer_fields_array_sql)
" ), ARRAY_A );
", ARRAY_A );

// Package data layer post fields.
foreach ( $query as $postmeta ) {
Expand Down
Loading