Skip to content

Commit 059cfc3

Browse files
committed
Reports: Prepare post type in query
1 parent 4b7d3f5 commit 059cfc3

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

public_html/wp-content/plugins/wordcamp-reports/classes/report/class-meetup-status.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -216,25 +216,22 @@ public function get_data() {
216216
}
217217

218218
/**
219-
* Get all Meetup posts which have status changed between given time fram
219+
* Get all Meetup posts which have status changed between given time frame.
220220
*
221221
* @return array
222222
*/
223223
protected function get_meetup_posts() {
224224
global $wpdb;
225225
$meetup_post_type = WCPT_MEETUP_SLUG;
226226
$meetup_post_objs = $wpdb->get_results(
227-
$wpdb->prepare(
228-
"
229-
SELECT DISTINCT post_id
230-
FROM {$wpdb->prefix}postmeta
231-
WHERE
232-
meta_key LIKE '_status_change_log_$meetup_post_type%'
233-
AND
234-
meta_value >= %d
235-
AND
236-
meta_value <= %d
237-
",
227+
$wpdb->prepare( "
228+
SELECT DISTINCT post_id
229+
FROM {$wpdb->prefix}postmeta
230+
WHERE
231+
meta_key LIKE %s AND
232+
meta_value >= %d AND
233+
meta_value <= %d",
234+
sprintf( '_status_change_log_%s%%', $meetup_post_type ),
238235
$this->range->start->getTimestamp(),
239236
$this->range->end->getTimestamp()
240237
)

0 commit comments

Comments
 (0)