Commit 82d1232
committed
PreGetPosts: improve the isEarlyMainQueryCheck() method [2]
This adds a second unit test which is based on the actual code which originally triggered the error.
The error was caused by the code in question using inline control structures (without braces) for the early main query check.
After the previous fix, that code would now throw a false positive.
I've fixed this now by adding an additional check for a `return` statement straight after the parenthesis closer of the `if()` statement.
Fixes 4991 parent 46895e9 commit 82d1232
File tree
2 files changed
+22
-0
lines changed- WordPressVIPMinimum
- Sniffs/Hooks
- Tests/Hooks
2 files changed
+22
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
324 | 336 | | |
325 | 337 | | |
326 | 338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
0 commit comments