wphooks.info - pre_get_comments

pre_get_comments

(trunk - 5.0-alpha-42177)

The hook occurs in the following file:

wp-includes/class-wp-comment-query.php:
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
		$this->meta_query = new WP_Meta_Query();
		$this->meta_query->parse_query_vars( $this->query_vars );

		/**
		 * Fires before comments are retrieved.
		 *
		 * @since 3.1.0
		 *
		 * @param WP_Comment_Query $this Current instance of WP_Comment_Query (passed by reference).
		 */
		do_action_ref_array( 'pre_get_comments', array( &$this ) );

		// Reparse query vars, in case they were modified in a 'pre_get_comments' callback.
		$this->meta_query->parse_query_vars( $this->query_vars );
		if ( ! empty( $this->meta_query->queries ) ) {
			$this->meta_query_clauses = $this->meta_query->get_sql( 'comment', $wpdb->comments, 'comment_ID', $this );
		}

		/*
		 * Only use the args defined in the query_var_defaults to compute the key,