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

Ade Walker photofantaisie at gmail.com
Tue Nov 25 23:50:32 GMT 2008


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.


More information about the wp-hackers mailing list