[wp-trac] [WordPress Trac] #51525: Add new functions apply_filters_single_type() and apply_filters_ref_array_single_type()

WordPress Trac noreply at wordpress.org
Wed Aug 7 23:55:10 UTC 2024


#51525: Add new functions apply_filters_single_type() and
apply_filters_ref_array_single_type()
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:  (none)
     Type:  feature request                      |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  2nd-opinion php8.x early has-patch   |     Focuses:
  has-unit-tests                                 |
-------------------------------------------------+-------------------------

Comment (by jrf):

 @dmsnell While I appreciate the idea, I don't think empirical data has any
 value in this case.

 It's been four years since PHP 8.4 has been released, so most commonly
 used plugins will have put guard code in to prevent acting on
 incorrect/unexpected input data to prevent their reputation being damages
 by other plugins/themes doing it wrong.
 And that includes Core too in a number of places.

 Where the value of the proposed functions is now, is mostly for new
 filters being added, whether it is Core or in plugins/themes. If these
 functions would be available, anything hooking into filters run via the
 new functions would not have to worry about type safety of the input
 anymore as they can be guaranteed that the type will be correct, which
 would allow for cleaner code inside the hooked in functions.

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


More information about the wp-trac mailing list