| 1 |
<?php |
| 2 |
// Set default config on plugin load if not set |
| 3 |
function flying_scripts_set_default_config() { |
| 4 |
|
| 5 |
if (FLYING_SCRIPTS_VERSION !== get_option('FLYING_SCRIPTS_VERSION')) { |
| 6 |
|
| 7 |
if (get_option('flying_scripts_timeout') === false) |
| 8 |
update_option('flying_scripts_timeout', 5); |
| 9 |
|
| 10 |
if (get_option('flying_scripts_include_list') === false) |
| 11 |
update_option('flying_scripts_include_list', []); |
| 12 |
|
| 13 |
if (get_option('flying_scripts_disabled_pages') === false) |
| 14 |
update_option('flying_scripts_disabled_pages', []); |
| 15 |
|
| 16 |
update_option('FLYING_SCRIPTS_VERSION', FLYING_SCRIPTS_VERSION); |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
add_action('plugins_loaded', 'flying_scripts_set_default_config'); |
| 21 |
|