Make WordPress Core


Ignore:
Timestamp:
03/18/2023 12:32:54 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-comment-query.php

    r55526 r55559  
    585585                        $include_unapproved = wp_parse_list( $this->query_vars['include_unapproved'] );
    586586
    587                         $unapproved_ids    = array();
    588                         $unapproved_emails = array();
    589587                        foreach ( $include_unapproved as $unapproved_identifier ) {
    590588                                // Numeric values are assumed to be user IDs.
     
    10141012         * @since 4.4.0
    10151013         *
    1016          * @global wpdb $wpdb WordPress database abstraction object.
    1017          *
    10181014         * @param WP_Comment[] $comments Array of top-level comments whose descendants should be filled in.
    10191015         * @return array
    10201016         */
    10211017        protected function fill_descendants( $comments ) {
    1022                 global $wpdb;
    1023 
    10241018                $levels = array(
    10251019                        0 => wp_list_pluck( $comments, 'comment_ID' ),
Note: See TracChangeset for help on using the changeset viewer.