[wp-trac] [WordPress Trac] #36935: Implement lazy-loading blog details in `WP_Site`
WordPress Trac
noreply at wordpress.org
Wed Jun 29 10:26:58 UTC 2016
#36935: Implement lazy-loading blog details in `WP_Site`
--------------------------------+-------------------------
Reporter: flixos90 | Owner: jeremyfelt
Type: enhancement | Status: reviewing
Priority: normal | Milestone: 4.6
Component: Networks and Sites | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses: multisite
--------------------------------+-------------------------
Comment (by jeremyfelt):
Replying to [comment:20 flixos90]:
> Replying to [comment:19 jeremyfelt]:
> > Details aren't available when `get_site()` is used in `sunrise.php`.
Should `isset()` return `false` when an option is not available?
>
> Sounds good to me. How exactly are we gonna determine that? An action
having run before? The globals being set?
On second thought, just returning `false` might be the right answer. We
probably shouldn't validate `isset` as a way to check if the property is
there. It will always be there, just sometimes not populated fully.
I did run into another issue.
If you attempt to access the site details before they can be populated
with `get_option()` (in `sunrise.php`), then they will be cached as false
and future access attempts will also receive `false`. `get_details()`
needs to skip caching of a property if `false` is returned from
`get_option()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36935#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list