Opened 4 years ago
Closed 4 years ago
#52882 closed defect (bug) (fixed)
get_term_link() WARNING
Reported by: | Tkama | Owned by: | SergeyBiryukov |
---|---|---|---|
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_link
filter. 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
false
and 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.