#49738 closed defect (bug) (invalid)
get_term_link will always generate a deprecated notice when used on post_tag or category
Reported by: | scorbaciufermecat | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.4 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
Using WordPress 5.4-RC5-47533
get_category_link and get_tag_link both in the end call get_term_link which will use a filter that is deprecated for tags and categories. https://prnt.sc/rq00x0
I just checked for solutions online and by mistake I got on a random site that google indexed https://jeanbaptisteaudras.com/en/technical/ - so maybe more people that don't have error reporting set to OFF will see this. Also, as a developer I would like to have debugging ON but I keep getting this notification.
Here is the commit that did that
https://github.com/WordPress/WordPress/commit/f60094679f4cae8268f79eff10ac247733377ace#diff-efd15818123d55a117706670be80c15aR4252
Thanks,
Andrei
Change History (8)
#1
follow-up:
↓ 2
@
5 years ago
- Keywords close added; has-screenshots dev-feedback needs-patch removed
- Severity changed from major to normal
#2
in reply to:
↑ 1
@
5 years ago
Sorry, it's my fault. I wasn't paying too much attention to the code.
Thanks for the clarifications,
Andrei
Hi there, welcome to WordPress Trac! Thanks for the report.
This is intentional behavior of
apply_filters_deprecated()
, it only outputs the deprecated hook message if you have any functions in your plugins or theme specifically hooked to the deprecatedtag_link
orcategory_link
filter. Those instances should be updated to useterm_link
instead.If you don't have any functions hooked to those deprecated filters, it returns early and doesn't do anything.