Opened 6 years ago
Closed 6 years ago
#52882 closed defect (bug) (fixed)
get_term_link() WARNING
| Reported by: | Tkama | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.8 |
| Component: | Taxonomy | Version: | 3.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.