foreach ($val as $arr_val) { $fdata[$key][] = stripslashes($arr_val); } } if ($fdata[$key] === false) { delete_option($key); } else { if (!get_option($key)) { add_option($key, '255', '', 'yes'); } update_option($key, $fdata[$key]); } } // try creating custom theme if (!get_option('nb_inline_css') && !empty($fdata['nb_custom_style'])) { if (!nb_create_custom_theme()) { if (!get_option('nb_inline_css')) { update_option('nb_inline_css', 1); } echo '<div class="updated"><p>' . __('An error occurred during dynamic CSS creation. The code will be used inline anyway', 'nb_ml') . '</p></div>'; } else { delete_option('nb_inline_css'); } } echo '<div class="updated"><p><strong>' . __('Options saved.', 'nb_ml') . '</strong></p></div>'; } } else { // Normal page display $fdata['nb_min_news_w'] = get_option('nb_min_news_w', 200); $fdata['nb_min_news_h'] = get_option('nb_min_news_h', 150); $fdata['nb_min_horiz_w'] = get_option('nb_min_horiz_w', 400);
function nb_init_custom_css() { include_once NB_DIR . '/functions.php'; // if enabled - create custom theme if (get_option('nb_custom_style')) { if (!nb_create_custom_theme()) { if (!get_option('nb_inline_css')) { update_option('nb_inline_css', 1); } } else { delete_option('nb_inline_css'); } } }