Coding Standards: Remove a one-time variable in WP_Privacy_Requests_Table::get_request_counts().
This allows the `$wpdb::prepare()` call to be picked up correctly by PHPCS. Follow-up to [43008], [45448]. Props aristath, poena, afercia, SergeyBiryukov. See #62279. Built from https://develop.svn.wordpress.org/trunk@60072 git-svn-id: http://core.svn.wordpress.org/trunk@59408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -116,14 +116,19 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
|
|||||||
return $counts;
|
return $counts;
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = "
|
$results = (array) $wpdb->get_results(
|
||||||
SELECT post_status, COUNT( * ) AS num_posts
|
$wpdb->prepare(
|
||||||
|
"SELECT post_status, COUNT( * ) AS num_posts
|
||||||
FROM {$wpdb->posts}
|
FROM {$wpdb->posts}
|
||||||
WHERE post_type = %s
|
WHERE post_type = %s
|
||||||
AND post_name = %s
|
AND post_name = %s
|
||||||
GROUP BY post_status";
|
GROUP BY post_status",
|
||||||
|
$this->post_type,
|
||||||
|
$this->request_type
|
||||||
|
),
|
||||||
|
ARRAY_A
|
||||||
|
);
|
||||||
|
|
||||||
$results = (array) $wpdb->get_results( $wpdb->prepare( $query, $this->post_type, $this->request_type ), ARRAY_A );
|
|
||||||
$counts = array_fill_keys( get_post_stati(), 0 );
|
$counts = array_fill_keys( get_post_stati(), 0 );
|
||||||
|
|
||||||
foreach ( $results as $row ) {
|
foreach ( $results as $row ) {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.8-beta3-60071';
|
$wp_version = '6.8-beta3-60072';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|||||||
Reference in New Issue
Block a user