Adding support for WP_Comment_Query #94

Merged
merged 4 commits into from Jan 3, 2017

Projects

None yet

2 participants

@JasonHoffmann
Contributor

Unit tests have been organized into their own folder.

+ public $default_args = array(
+ 'number' => 10,
+ 'offset' => 0,
+ 'no_found_rows' => false,
@jjeaton
jjeaton Jan 3, 2017 Contributor

Is no_found_rows responsible for determining the total count? If so, would we need to keep this? (and maybe on other queries too?)

@jjeaton
jjeaton Jan 3, 2017 Contributor

Ah, so by setting it to false, that's what we're doing right?

@JasonHoffmann
JasonHoffmann Jan 3, 2017 Contributor

If no_found_rows is set to true, which is the default, then $query->found_comments will always return 0. The only way I can think of to get the total number of results (similar to found_posts) in comments is to set that to false, even though it slows down the query a bit.

@jjeaton
jjeaton Jan 3, 2017 Contributor

@JasonHoffmann yep you're doing it right. I read it as "found_rows" false, instead of the opposite.

@jjeaton
jjeaton approved these changes Jan 3, 2017 View changes
@JasonHoffmann
Contributor

Fixes #42

@JasonHoffmann JasonHoffmann merged commit 4b806c8 into master Jan 3, 2017

1 check passed

Scrutinizer Analysis: 7 new issues, 12 updated code elements – Tests: passed
Details
@JasonHoffmann JasonHoffmann deleted the feature-comment-query branch Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment