WordPress.org

Make WordPress Core

Ticket #23469: pre_get_comments-before_meta_parse.diff

File pre_get_comments-before_meta_parse.diff, 650 bytes (added by kasparsd, 5 years ago)

Move the pre_get_comments filter before the meta_query parser

  • wp-includes/comment.php

    diff --git wp-includes/comment.php wp-includes/comment.php
    index 65e18a7..15e8de3 100644
    class WP_Comment_Query { 
    240240
    241241                $this->query_vars = wp_parse_args( $query_vars, $defaults );
    242242
     243                do_action_ref_array( 'pre_get_comments', array( &$this ) );
     244
    243245                // Parse meta query
    244246                $this->meta_query = new WP_Meta_Query();
    245247                $this->meta_query->parse_query_vars( $this->query_vars );
    246248
    247                 do_action_ref_array( 'pre_get_comments', array( &$this ) );
    248249                extract( $this->query_vars, EXTR_SKIP );
    249250
    250251                // $args can be whatever, only use the args defined in defaults to compute the key