[wp-hackers] get_option for an element in an array

Stephen Rider wp-hackers at striderweb.com
Wed Nov 26 02:30:12 GMT 2008


In certain circumstances it might be better to split the array up a  
bit -- if you have a particular span of data that is both large and  
used less frequently, you could split out the smaller, more frequently  
accessed info into a separate array.

Generally speaking though, you're okay just putting it all in one array.

Stephen

On Nov 25, 2008, at 5:50 PM, Ade Walker wrote:

> 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)?



More information about the wp-hackers mailing list