#48255 closed defect (bug) (fixed)
Consistent deprecation of action and filter hooks
| Reported by: | jrf | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.4 |
| Component: | General | Version: | 5.3 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | docs, coding-standards |
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@deprecatedtag, 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.xversion format.
The attached patches would fix these inconsistencies.
Attachments (5)
Change History (17)
@
7 years ago
Deprecated hooks: improve documentation Let the docs link to the replacement when available.
@
7 years ago
Documentation: use short docblock style comments for "filter documented elsewhere" comments
#1
@
7 years ago
- Milestone Awaiting Review → 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
@
7 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
@
7 years ago
Note: The changes from 48255-deprecated-hooks-use-short-docblock-style.patch are already applied in [46610].
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Use the correct function for deprecated hooks