#48255 closed defect (bug) (fixed)
Consistent deprecation of action and filter hooks
Reported by: | jrf | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.4 | Priority: | normal |
Severity: | normal | Version: | 5.3 |
Component: | General | Keywords: | has-patch |
Focuses: | docs, coding-standards | Cc: |
Description
While testing a new sniff for WPCS, I ran into an number of inconsistencies regarding hook deprecation.
In particular:
- Over 30 deprecated hook call not using the
do_action_deprecated()
/apply_filters_deprecated()
functions. - Not using
{@see ...}
for the replacement in the@deprecated
tag, meaning the Dev handbook won't automatically link to the replacement. - Hook documentation not being in the most logical place for the hook.
This filter is documented in ...
comments not using short docblock style.- A few deprecated hook calls in tests using version numbers which don't comply with the
x.x.x
version format.
The attached patches would fix these inconsistencies.
Attachments (5)
Change History (17)
@
5 years ago
Deprecated hooks: improve documentation Let the docs link to the replacement when available.
@
5 years ago
Documentation: use short docblock style comments for "filter documented elsewhere" comments
#1
@
5 years ago
- Milestone changed from Awaiting Review to 5.4
Although the majority of the proposals here are docs only changes a couple of patches are not, hence adding to 5.4 rather than late in the 5.3 milestone cycle
#6
@
5 years ago
Looking at [46686] and the failures it fixed, it appears that while the enable_xmlrpc
option was deprecated in [21804] / #21509, the pre_option_*
and option_*
filters added there for backwards compatibility are not deprecated, so apply_filters_deprecated()
should not be used there.
#8
@
5 years ago
Note: The changes from 48255-deprecated-hooks-use-short-docblock-style.patch are already applied in [46610].
#9
@
5 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 46689:
Use the correct function for deprecated hooks