Пример #1
0
 public function loading()
 {
     global $wpdb;
     /**
      * Add our table structure for version 2.8.
      */
     require_once ABSPATH . 'wp-admin/includes/upgrade.php';
     // Create our object meta table
     $sql = "CREATE TABLE IF NOT EXISTS " . NF_OBJECT_META_TABLE_NAME . " (\n\t\t  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t  `object_id` bigint(20) NOT NULL,\n\t\t  `meta_key` varchar(255) NOT NULL,\n\t\t  `meta_value` longtext NOT NULL,\n\t\t  PRIMARY KEY (`id`)\n\t\t) DEFAULT CHARSET=utf8;";
     dbDelta($sql);
     // Create our object table
     $sql = "CREATE TABLE IF NOT EXISTS " . NF_OBJECTS_TABLE_NAME . " (\n\t\t  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t  `type` varchar(255) NOT NULL,\n\t\t  PRIMARY KEY (`id`)\n\t\t) DEFAULT CHARSET=utf8;";
     dbDelta($sql);
     // Create our object relationships table
     $sql = "CREATE TABLE IF NOT EXISTS " . NF_OBJECT_RELATIONSHIPS_TABLE_NAME . " (\n\t\t  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n\t\t  `child_id` bigint(20) NOT NULL,\n\t\t  `parent_id` bigint(20) NOT NULL,\n\t\t  `child_type` varchar(255) NOT NULL,\n\t\t  `parent_type` varchar(255) NOT NULL,\n\t\t  PRIMARY KEY (`id`)\n\t\t) DEFAULT CHARSET=utf8;";
     dbDelta($sql);
     // Remove old email settings.
     nf_change_email_fav();
     nf_remove_old_email_settings();
     // Get our total number of forms.
     $form_count = nf_get_form_count();
     // Get all our forms
     $forms = ninja_forms_get_all_forms(true);
     $x = 1;
     if (is_array($forms)) {
         foreach ($forms as $form) {
             $this->args['forms'][$x] = $form['id'];
             $x++;
         }
     }
     if (empty($this->total_steps) || $this->total_steps <= 1) {
         $this->total_steps = $form_count;
     }
     $args = array('total_steps' => $this->total_steps, 'step' => 1);
     $this->redirect = admin_url('index.php?page=nf-about');
     return $args;
 }
Пример #2
0
 private function removeOldEmailSettings()
 {
     nf_change_email_fav();
     nf_remove_old_email_settings();
 }
/**
 * Clearing out the old email favourite field and replacing it with the new version.
 *
 * @since 2.8.4
 * @return void
 */
function nf_clear_old_favs() {
	global $wpdb;

	$email_fav_updated = get_option( 'nf_email_fav_updated', false );

	if ( $email_fav_updated )
		return false;

	nf_change_email_fav();
	nf_remove_old_email_settings();
	nf_change_state_dropdown_fav();

	update_option( 'nf_email_fav_updated', true );
}
Пример #4
0
 public function step()
 {
     // Get our form ID
     $form_id = $this->args['forms'][$this->step];
     nf_remove_old_email_settings($form_id);
 }