Opened 6 years ago
Closed 6 years ago
#48123 closed defect (bug) (fixed)
Remove `$accepted_args` from hooks, whose callbacks do not have any arguments
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.3 | Priority: | low |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | has-patch |
| Focuses: | coding-standards | Cc: |
Description
Some callable functions do not accept any arguments, but they have 1 as accepted argument numbers in default-filters.php. This patch removes them.
Attachments (2)
Change History (11)
#2
@
6 years ago
- Keywords needs-refresh added
- Milestone changed from Awaiting Review to Future Release
- Priority changed from normal to low
- Version trunk deleted
Thanks for the patch @itowhid06 . The default value for the $accepted_args parameter of add_action() is 1, so this change doesn't correct anything.
Can you update the patch to change the parameter to 0 where appropriate?
#5
follow-up:
↓ 7
@
6 years ago
Confirmed that none of these three functions take arguments:
- https://developer.wordpress.org/reference/functions/do_feed_rdf/
- https://developer.wordpress.org/reference/functions/do_feed_rss/
- https://developer.wordpress.org/reference/functions/do_all_pings/
Relevant hook calls:
I've not been able to find a WP native do_action() call with the hook name do_pings, though that is outside the scope of this ticket.
Note: See
TracTickets for help on using
tickets.
Related #48094