function ninja_forms_ajax_migrate_database() { if (!current_user_can(apply_filters('ninja_forms_admin_upgrade_migrate_database_capabilities', 'manage_options'))) { return; } $migrations = new NF_Database_Migrations(); $migrations->nuke(true, true); $migrations->migrate(); echo json_encode(array('migrate' => 'true')); wp_die(); }
/** * Activation */ public function activation() { update_option('ninja_forms_freemius', 1); $migrations = new NF_Database_Migrations(); $migrations->migrate(); }
private function _migrate() { $migrations = new NF_Database_Migrations(); $migrations->nuke(TRUE, TRUE); $posts = get_posts('post_type=nf_sub&numberposts=-1'); foreach ($posts as $post) { wp_delete_post($post->ID, TRUE); } $migrations->migrate(); }
/** * Activation */ public function activation() { $migrations = new NF_Database_Migrations(); $migrations->migrate(); if (Ninja_Forms()->form()->get_forms()) { return; } $form = Ninja_Forms::template('formtemplate-contactform.nff', array(), TRUE); Ninja_Forms()->form()->import_form($form); }