[wp-trac] [WordPress Trac] #27935: Multisite get_site_option() does not cache empty string values in "SITE_ID:notoptions"
WordPress Trac
noreply at wordpress.org
Sun Apr 20 08:37:08 UTC 2014
#27935: Multisite get_site_option() does not cache empty string values in
"SITE_ID:notoptions"
--------------------------------+-----------------------------
Reporter: doublesharp | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Options, Meta APIs | Version: 3.7
Severity: normal | Keywords:
Focuses: |
--------------------------------+-----------------------------
In a multisite configuration the `get_site_option()` function in `wp-
includes/option.php` does not cache `meta_key`s with `meta_value`s of
empty strings resulting in a database query being run on every request.
Checking for a `meta_value` matching an empty string to trigger an entry
into the `notoptions` cache will correct this behavior.
from:
{{{#!php
if ( is_object( $row ) )
}}}
to:
{{{#!php
if ( is_object( $row ) && $row->meta_value !== '' )
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27935>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list