private static function _save_search_registration($args) { extract(wp_parse_args($args, array('last_hash' => '', 'search_parameters' => array(), 'url' => '', 'upstream_url' => '', 'user_name' => '', 'user_email' => '', 'user_phone' => ''))); $search_parameters = array_filter($search_parameters, array('DispletRetsIdxUtilities', 'not_empty_excluding_zero')); if (!empty($user_email) && !empty($search_parameters)) { $response = array(); $user_id = DispletRetsIdxUsersModel::get_user_id_by_email($user_email); if (empty($user_id)) { $result = DispletRetsIdxLeadsController::create_new_re_search_user(array('email' => $user_email, 'last_hash' => $last_hash, 'name' => $user_name, 'phone' => $user_phone, 'url' => $url, 'upstream_url' => $upstream_url, 'use_cron' => false)); if (empty($result['success'])) { return $result; } $user_id = $result['user_id']; $response[] = 'Created User'; } if (!empty($user_id)) { $response[] = self::_save_search(array('hash' => DispletRetsIdxResidentialsModel::get_hash_from_search_parameters($search_parameters), 'search_name' => current_time('Y/m/d g:i:s A'), 'user' => get_userdata($user_id))); return implode(' & ', $response); } } }