Issues with getting the amcharts_options using get_option
-
Hi,
When grabbing the settings from the wp-option “amcharts_option” you are passing in a default param of “amcharts_get_defaults()”. That function is being evaluated even if the option is being returned properly.
Right now the call to get the options is:
$settings = get_option( 'amcharts_options', amcharts_get_defaults() );
If you switch it to:
$settings = get_option( 'amcharts_options' ); if ($settings === false) { $settings = amcharts_get_defaults(); }
it will only run the amcharts_get_defaults function when necessary.
On my dev environments the get_defaults ends up timing out trying to pull the resource list from the amcharts website, so constantly running that function causes the admin to be frustratingly slow.
Thanks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Issues with getting the amcharts_options using get_option’ is closed to new replies.