I am currently working on a plugin for WordPress, and i am trying to fetch the widget options using get_options
. As a result, I get an array with the options and option name as the key, but for some reason I can't read it:
$options = get_option('widget_widgetname');
var_dump($options);
This is the output of var_dump()
:
array(2) { [2]=> array(5)
{
["string"]=> string(6) "Search"
["title"]=> string(12) "WDSearchForm"
["show_wrapper"]=> string(0) ""
["animate"]=> string(0) ""
["animateWidth"]=> string(2) "80"
}
["_multiwidget"]=> int(1) }
but when I do the following, it doesn't work:
echo $options["string"]; // No output
echo $options["title"]; // No output