[wp-trac] [WordPress Trac] #16287: get_option() - store retrieved option in a global array?

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 18 22:22:58 UTC 2011


#16287: get_option() - store retrieved option in a global array?
----------------------------------+----------------------
 Reporter:  digitalnature         |       Owner:
     Type:  enhancement           |      Status:  closed
 Priority:  normal                |   Milestone:
Component:  Database              |     Version:  3.1
 Severity:  normal                |  Resolution:  invalid
 Keywords:  get_option, database  |
----------------------------------+----------------------

Comment (by scribu):

 That was apparently caused by the fact that the cached value wasn't
 unserialized.

 Instead, I modified the last line of get_option() to this:

 {{{
 return $__wp_settings[$option] = apply_filters( 'option_' . $option,
 maybe_unserialize( $value ) );
 }}}

 Now the page is displaying properly and the query count remains the same
 as with a clean install, proving that the options are indeed stored in a
 global already.

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


More information about the wp-trac mailing list