function inbound_store_lead($args, $return = true) { global $user_ID, $wpdb; if (!is_array($args)) { $args = array(); } /* Mergs $args with POST request for support of ajax and direct calls */ $args = array_merge($args, $_POST); /* wpleads_email_address becomes wpleads_email */ $args['email'] = $args['wpleads_email_address']; /* loop through and remove wpleads_ (we will add them back in the new method ) */ foreach ($args as $key => $value) { $newkey = str_replace('wpleads_', '', $key); unset($args[$key]); $args[$newkey] = $value; } /* Send data through new method */ $Leads = new LeadStorage(); if ($return) { $Leads->set_mode('return'); } else { $Leads->set_mode('ajax'); } /* prepare lead lists as array */ if (isset($args['lead_lists']) && !is_array($args['lead_lists'])) { $args['lead_lists'] = explode(',', $args['lead_lists']); } $lead_id = $Leads::inbound_lead_store($args); return $lead_id; }