Coding Standards: Remove unused variables in WP_Comment_Query.

* `$unapproved_ids` and `$unapproved_emails` in `WP_Comment_Query::get_comment_ids()` were added in [29965] and appear to never have been used.
* `$wpdb` in `WP_Comment_Query::fill_descendants()` was replaced with `$this->db` in [38275], removed in [38446], and accidentally reinstated in [38768].

Follow-up to [29965], [34546], [37625], [38275], [38446], [38768], [44546].

Props upadalavipul, dingo_d, audrasjb, SergeyBiryukov.
Fixes #57482.

git-svn-id: https://develop.svn.wordpress.org/trunk@55559 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2023-03-18 12:32:54 +00:00
parent 1eba58d5a6
commit b5ecdb1c9c

View File

@@ -584,8 +584,6 @@ class WP_Comment_Query {
if ( ! empty( $this->query_vars['include_unapproved'] ) ) {
$include_unapproved = wp_parse_list( $this->query_vars['include_unapproved'] );
$unapproved_ids = array();
$unapproved_emails = array();
foreach ( $include_unapproved as $unapproved_identifier ) {
// Numeric values are assumed to be user IDs.
if ( is_numeric( $unapproved_identifier ) ) {
@@ -1013,14 +1011,10 @@ class WP_Comment_Query {
*
* @since 4.4.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param WP_Comment[] $comments Array of top-level comments whose descendants should be filled in.
* @return array
*/
protected function fill_descendants( $comments ) {
global $wpdb;
$levels = array(
0 => wp_list_pluck( $comments, 'comment_ID' ),
);