Opened 2 years ago
Closed 20 months ago
#17883 closed defect (bug) (fixed)
get_blog_option queries DB on default blog_id
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.3 |
| Component: | Multisite | Version: | 3.1.3 |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description
If get_blog_option is passed null for a blog_id, it queries the DB instead of using the current blog option cache.
In most, if not all, of the MS specific functions that have a $blog_id, if $blog_id is null, the current blog is used.
patch is attached.
Attachments (1)
Change History (9)
comment:2
SergeyBiryukov — 21 months ago
- Milestone changed from Awaiting Review to 3.3
Sorry wpmuguru, tried to stop the commit to include props. Thanks for the contribution as always :-)
- Owner set to ryan
- Status changed from new to reviewing
Leaving this open so ryan can review it.
Replying to nacin:
Sorry wpmuguru, tried to stop the commit to include props. Thanks for the contribution as always :-)
No problem - I've done the same.
Note: See
TracTickets for help on using
tickets.

The $wpdb->get_blog_prefix( ... will return the prefix for the current blog when null is passed. So, the current implementation defaults to the current blog but queries the DB instead of retrieving from cache.