Opened 7 years ago
Closed 7 years ago
#48123 closed defect (bug) (fixed)
Remove `$accepted_args` from hooks, whose callbacks do not have any arguments
| Reported by: | itowhid06 | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | low | Milestone: | 5.3 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | coding-standards |
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
@
7 years ago
- Keywords needs-refresh added
- Milestone Awaiting Review → Future Release
- Priority normal → low
- Version trunk
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
@
7 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related #48094