[wp-trac] [WordPress Trac] #20712: Wrong data type returned from get_option for "page_on_front" after update_option

WordPress Trac wp-trac at lists.automattic.com
Sun May 20 09:14:08 UTC 2012


#20712: Wrong data type returned from get_option for "page_on_front" after
update_option
--------------------------+------------------------------
 Reporter:  tszming       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.3.2
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by dd32):

 Some core options have pre-save sanitization hooks, most numeric core
 options have intval() as their sanitizer.

 In general, WordPress treats all Identifiers as numeric strings, most
 functions will return either a numeric string, or a literal integer.
 As a result, === shouldn't be used for comparison of core numeric ID's.

 The ticket I linked to, is the opposite of this.. If you save an option
 with an Int value, it'll return as the numeric string representation.

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


More information about the wp-trac mailing list