Opened 5 years ago
Closed 5 years ago
#52882 closed defect (bug) (fixed)
get_term_link() WARNING
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.8 | Priority: | normal |
| Severity: | normal | Version: | 3.1 |
| Component: | Taxonomy | Keywords: | has-patch |
| Focuses: | Cc: |
Description
$rewrite parameter for the register_taxonomy() function can be set as false. Doing so we get such WARNING
Attachments (2)
Change History (5)
Note: See
TracTickets for help on using
tickets.
Hi there, thanks for the report and the patch.
I was able to reproduce the issue, but only when the taxonomy also has a custom permalink structure, either by calling
add_permastruct()or using thepre_term_linkfilter. By default,add_permastruct()is only called for a taxonomy if the `rewrite` argument is not false, which is the opposite of what's being reported here.Otherwise, the $wp_rewrite->get_extra_permastruct() call a few lines above returns
falseand the control gets into the first conditional branch, and not the one that causes the warning.52882.diff includes a unit test.
This is not new in 5.7 and appears to be introduced in [15824], adjusting the version accordingly.