Example #1
0
 public function upgrade($old_db_version = false)
 {
     global $wpdb;
     //$frm_db_version is the version of the database we're moving to
     $frm_db_version = FrmAppHelper::$db_version;
     $old_db_version = (double) $old_db_version;
     if (!$old_db_version) {
         $old_db_version = get_option('frm_db_version');
     }
     if ($frm_db_version != $old_db_version) {
         // update rewrite rules for views and other custom post types
         flush_rewrite_rules();
         require_once ABSPATH . 'wp-admin/includes/upgrade.php';
         $this->create_tables();
         $this->migrate_data($frm_db_version, $old_db_version);
         /***** SAVE DB VERSION *****/
         update_option('frm_db_version', $frm_db_version);
         /**** ADD/UPDATE DEFAULT TEMPLATES ****/
         FrmXMLController::add_default_templates();
     }
     do_action('frm_after_install');
     /**** update the styling settings ****/
     if (is_admin() && function_exists('get_filesystem_method')) {
         $frm_style = new FrmStyle();
         $frm_style->update('default');
     }
 }
 public static function save_css()
 {
     $frm_style = new FrmStyle();
     $message = '';
     $post_id = FrmAppHelper::get_post_param('ID', false, 'sanitize_text_field');
     $nonce = FrmAppHelper::get_post_param('frm_custom_css', '', 'sanitize_text_field');
     if (wp_verify_nonce($nonce, 'frm_custom_css_nonce')) {
         $frm_style->update($post_id);
         $message = __('Your styling settings have been saved.', 'formidable');
     }
     return self::custom_css($message);
 }
Example #3
0
 private static function maybe_update_stylesheet($imported)
 {
     if (isset($imported['imported']['styles']) && !empty($imported['imported']['styles']) || isset($imported['updated']['styles']) && !empty($imported['updated']['styles'])) {
         if (is_admin() && function_exists('get_filesystem_method')) {
             $frm_style = new FrmStyle();
             $frm_style->update('default');
         }
     }
 }
 private static function maybe_update_stylesheet($imported)
 {
     $new_styles = isset($imported['imported']['styles']) && !empty($imported['imported']['styles']);
     $updated_styles = isset($imported['updated']['styles']) && !empty($imported['updated']['styles']);
     if ($new_styles || $updated_styles) {
         if (is_admin() && function_exists('get_filesystem_method')) {
             $frm_style = new FrmStyle();
             $frm_style->update('default');
         }
         foreach ($imported['forms'] as $form_id) {
             self::update_custom_style_setting_after_import($form_id);
         }
     }
 }