public static function load_css() { header('Content-type: text/css'); $frm_style = new FrmStyle(); $defaults = $frm_style->get_defaults(); include FrmAppHelper::plugin_path() . '/css/_single_theme.css.php'; wp_die(); }
/** * Migrate style to custom post type */ private static function migrate_to_27() { $new_post = array('post_type' => FrmStylesController::$post_type, 'post_title' => __('Formidable Style', 'formidable'), 'post_status' => 'publish', 'post_content' => array(), 'menu_order' => 1); $exists = get_posts(array('post_type' => $new_post['post_type'], 'post_status' => $new_post['post_status'], 'numberposts' => 1)); if ($exists) { $new_post['ID'] = reset($exists)->ID; } $frmpro_settings = get_option('frmpro_options'); // If unserializing didn't work if (!is_object($frmpro_settings)) { if ($frmpro_settings) { //workaround for W3 total cache conflict $frmpro_settings = unserialize(serialize($frmpro_settings)); } } if (!is_object($frmpro_settings)) { return; } $frm_style = new FrmStyle(); $default_styles = $frm_style->get_defaults(); foreach ($default_styles as $setting => $default) { if (isset($frmpro_settings->{$setting})) { $new_post['post_content'][$setting] = $frmpro_settings->{$setting}; } } $frm_style->save($new_post); }