[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
Thu Aug 8 13:34:23 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):

 > It would be good to handle, or at least anticipate union types and
 nullable types, based on PHP syntax (for instance ?int|string).

 I'm not sure this actually has merit as in the case of a multi-type input,
 the hooked in functions would need type checks anyhow, so what would be
 the benefits of using the new functions in that case ?

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


More information about the wp-trac mailing list