[wp-trac] [WordPress Trac] #31820: get_option() returns Integers as strings

WordPress Trac noreply at wordpress.org
Tue Mar 31 15:53:53 UTC 2015


#31820: get_option() returns Integers as strings
--------------------------------+------------------------------
 Reporter:  golderweb           |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Options, Meta APIs  |     Version:  4.1.1
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:
--------------------------------+------------------------------

Comment (by boonebgorges):

 See also #22192. All scalar values passed to `update_option()` are
 ultimately stored in a 'longtext' field in the database, which means that
 they're retrieved as strings. There's nothing we can really do about this,
 given the current schema - it doesn't seem safe to me to assume that
 anything numeric should be cast to int/float during `get_option()`. We
 could probably make this a bit clearer in the inline documentation.

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


More information about the wp-trac mailing list