[wp-testers] Changes

Jason Webster jason at intraffic.net
Tue Jul 15 16:40:52 GMT 2008


Ok, I'm not looking at the 2.6 source right now, so I'm not sure if 
anything has changed. However, I can tell you that options are already 
serialized/unserialized by Wordpress when they go into or come out of, 
the database. This has been true for quite a while now.

For example, here's the last line of the get_option() function:

    return apply_filters( 'option_' . $setting, maybe_unserialize( 
$value ) );

So, get_option() will automatically unserialize any data it returns to you.


Duane Storey wrote:
> It seems like strange behavior though to mess with the data going in
> and out of the database that a plugin is using. I mean, it's quite
> possible I actually wanted it in a serialized form, so why would
> wordpress undo the serialization for the cache?  I would think a
> proper cache would store it as serialized, since that's what I asked
> to be put into the database.
>
> On 7/15/08, Jason Webster <jason at intraffic.net> wrote:
>   
>> You may want to look into the WP function maybe_unserialize().
>>
>>  It'll safeguard you from any caching mixups. Also of note, WP provides a
>> few other handy functions w/r/t serialization, such as is_serialized().
>>
>>  Duane Storey wrote:
>>
>>     
> _______________________________________________
> wp-testers mailing list
> wp-testers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-testers
>   



More information about the wp-testers mailing list