[wp-trac] [WordPress Trac] #64828: add_filter() used on actions and add_action() used on filters in core

WordPress Trac noreply at wordpress.org
Sun Mar 8 23:48:14 UTC 2026


#64828: add_filter() used on actions and add_action() used on filters in core
--------------------------+-----------------------------
 Reporter:  apermo        |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  7.0
Component:  General       |     Version:
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"61866" 61866]:
 {{{
 #!CommitTicketReference repository="" revision="61866"
 Code Quality: Correct hook registration type mismatches.

 Though `add_action()` and `add_filter()` are functionally equivalent
 internally, for proper semantics the former should be used on actions and
 the latter on filters.

 Follow-up to [37920], [38046], [53266].

 Props apermo.
 Fixes #64828.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64828#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list