[wp-trac] [WordPress Trac] #61631: sanitize_option_{$option} inconsistencies

WordPress Trac noreply at wordpress.org
Thu Jul 11 13:42:26 UTC 2024


#61631: sanitize_option_{$option} inconsistencies
--------------------------------+------------------------------
 Reporter:  liedekef            |       Owner:  (none)
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Options, Meta APIs  |     Version:  6.5.5
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:
--------------------------------+------------------------------

Comment (by roytanck):

 The 'sanitize_email' function expects only a single argument, so adding
 `10, 2` would actually cause a PHP error.
 https://developer.wordpress.org/reference/functions/sanitize_email/

 In case of (2), the callback function is defined when `register_setting`
 is called to register a new setting (usually from a plugin or theme).
 Unless the option is a default option, the callback is called with a
 single argument, the option's value. This is simply how the Setting API
 works. Since the option's key is path of the hook's name, there's little
 point in supplying it as a argument.

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


More information about the wp-trac mailing list