WordPress.org

Make WordPress Core

Opened 10 days ago

Last modified 9 days ago

#48255 new defect (bug)

Consistent deprecation of action and filter hooks

Reported by: jrf Owned by:
Milestone: 5.4 Priority: normal
Severity: normal Version: trunk
Component: General Keywords: has-patch
Focuses: docs, coding-standards Cc:
PR Number:

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.

Related: #41121, #48252, #48254

Attachments (5)

48255-deprecated-hooks-use-the-correct-function.patch (18.1 KB) - added by jrf 10 days ago.
Use the correct function for deprecated hooks
48255-deprecated-hooks-improve-documentation.patch (17.3 KB) - added by jrf 10 days ago.
Deprecated hooks: improve documentation Let the docs link to the replacement when available.
48255-deprecated-hooks-correct-placement-of-hook-documentatio.patch (2.6 KB) - added by jrf 10 days ago.
Documentation: correct placement of hook documentation x 2
48255-deprecated-hooks-use-short-docblock-style.patch (2.6 KB) - added by jrf 10 days ago.
Documentation: use short docblock style comments for "filter documented elsewhere" comments
48255-deprecated-hooks-tests-use-x.x.x-style-version-nrs.patch (3.3 KB) - added by jrf 10 days ago.
[Tests] Deprecated hooks: use x.x.x style version numbers

Download all attachments as: .zip

Change History (6)

@jrf
10 days ago

Use the correct function for deprecated hooks

@jrf
10 days ago

Deprecated hooks: improve documentation Let the docs link to the replacement when available.

@jrf
10 days ago

Documentation: correct placement of hook documentation x 2

@jrf
10 days ago

Documentation: use short docblock style comments for "filter documented elsewhere" comments

@jrf
10 days ago

[Tests] Deprecated hooks: use x.x.x style version numbers

#1 @netweb
9 days 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

Note: See TracTickets for help on using tickets.