Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PreGetPosts: improve the isEarlyMainQueryCheck() method
This adds a unit test which results in the error as reported in issue 499 and fixes the error properly. The error was caused by the presumption in the code that if an a check for `is_main_query` has a scope condition which is a `closure`, that the `closure` is the callback in the hook function call and that therefore the outer parenthesis (those of the function call) should be disgarded and the next parenthesis will be the ones for the `if` statement which will always have a scope opener and closer. Now read the above sentence again and count the number of assumptions in that statement ;-) Either way, the fix I've now added should stabilize this part of the code. Fixes 499
- Loading branch information