WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#20719 closed defect (bug) (invalid)

update_site_option can't handle saving objects

Reported by: griffinjt Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: Multisite Keywords:
Focuses: Cc:
PR Number:

Description

When using the update_option function, if an object is passed as the value, the function automatically clones and serializes (if necessary) the value before saving, and then get_option unserializes (if necessary) when retrieving the data.

update_site_option does not do this, so it cannot handle saving objects unless you add a workaround using the pre_update_site_option_* filter or just check for serializing when saving and retrieving the data. One would expect for update_site_option to be able to handle objects, too.

Change History (2)

#1 @griffinjt
8 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Wow, I am blind. I see the maybe_serialize now in update_site_option. Closing due to Monday morning madness.

#2 @SergeyBiryukov
8 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.