function get_feeds($feed_add_on) { $form_id = $this->get_form_id(); $feeds = array(); if (is_subclass_of($feed_add_on['class'], 'GFFeedAddOn')) { /* @var GFFeedAddOn $add_on */ $add_on = call_user_func(array($feed_add_on['class'], 'get_instance')); $feeds = $add_on->get_feeds($form_id); } else { // Legacy add-ons switch ($feed_add_on['slug']) { case 'gravityformszapier': if (class_exists('GFZapierData')) { $feeds = GFZapierData::get_feed_by_form($form_id); } break; case 'gravityformsuserregistration': if (class_exists('GFUserData')) { $feeds = GFUserData::get_feeds($form_id); } break; } } return $feeds; }
function get_feeds() { $form_id = $this->get_form_id(); if (class_exists('GF_User_Registration')) { $feeds = parent::get_feeds(); } else { $feeds = GFUserData::get_feeds($form_id); } return $feeds; }
public static function get_pending_activation_forms() { $forms = RGFormsModel::get_forms(null, 'title'); $feeds = GFUserData::get_feeds(); $available_form_ids = array(); foreach ($feeds as $feed) { if (self::is_pending_activation_enabled($feed)) { $available_form_ids[] = $feed['form_id']; } } $available_form_ids = array_unique($available_form_ids); $available_forms = array(); foreach ($forms as $form) { if (in_array($form->id, $available_form_ids)) { $available_forms[] = $form; } } return $available_forms; }
/** * Maybe update user role of the specified lead and feed * * @param array $lead * @param Feed $feed */ private function maybe_update_user_role($lead, $feed) { $user = false; // Gravity Forms User Registration Add-On if (class_exists('GFUserData')) { $user = GFUserData::get_user_by_entry_id($lead['id']); } if (false === $user) { $created_by = $lead[Pronamic_WP_Pay_Extensions_GravityForms_LeadProperties::CREATED_BY]; $user = new WP_User($created_by); } if ($user && !empty($feed->user_role_field_id) && isset($lead[$feed->user_role_field_id])) { $value = $lead[$feed->user_role_field_id]; $value = GFCommon::get_selection_value($value); $user->set_role($value); } }
public static function uninstall() { //loading data lib require_once self::get_base_path() . "/data.php"; if (!self::has_access("gravityforms_user_registration_uninstall")) { die(__("You don't have adequate permission to uninstall the User Registration Add-On.", "gravityformsuserregistration")); } //droping all tables GFUserData::drop_tables(); //removing options delete_option("gf_user_registration_version"); //Deactivating plugin $plugin = "gravityformsuserregistration/userregistration.php"; deactivate_plugins($plugin); update_option('recently_activated', array($plugin => time()) + (array) get_option('recently_activated')); }