[wp-hackers] get_option for an element in an array
DD32
wordpress at dd32.id.au
Tue Nov 25 23:55:52 GMT 2008
No.
The full array is stored as a serialised string in the database, so
regardless, it needs to be fully loaded and fully decoded.
If you have autoload = 'yes' then this will happen when WP loads
initially, regardless of if you use the contents.
The deserialization only occurs once per page load.
On Wed, 26 Nov 2008 10:50:32 +1100, Ade Walker <photofantaisie at gmail.com>
wrote:
> Hi all,
>
> In a plugin I'm working on, the option settings are saved as an array. I
> normally use something like this to extract a specific setting within the
> array:
>
> $myOptions = get_option('my_plugin_settings');
> echo $myOptions['specific_setting'];
>
> Is there a way of directly retrieving the specific setting within the
> array
> without having to retrieve the entire contents of the array first? Maybe
> this doesn't matter too much, but what if the array contains a lot of
> settings and data (thinking of performance)?
>
> Thanks in advance.
>
> Ade.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list