[wp-trac] [WordPress Trac] #21989: update_option() calls sanitize_option() twice when option does not exist

WordPress Trac wp-trac at lists.automattic.com
Tue Sep 25 05:54:33 UTC 2012


#21989: update_option() calls sanitize_option() twice when option does not exist
-------------------------------------------------+-------------------------
 Reporter:  MikeSchinkel                         |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Administration                       |  Review
 Severity:  normal                               |     Version:
 Keywords:  needs-patch dev-feedback 2nd-        |  Resolution:
  opinion                                        |
-------------------------------------------------+-------------------------

Comment (by nacin):

 I imagine the issue here is specifically related to the saving of a
 settings screen, and not usage of update_option() at the API level. In
 that case, it seems like the onus is on the developer to ensure such an
 option is initialized in the database. There are two schools of thought,
 but an option like this should ''certainly'' be initialized if that kind
 of side effect could occur.

 If there were any possible route to an elegant solution here, I probably
 wouldn't be suggesting essentially a wontfix. But there isn't one, alas.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21989#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list