changed all role occurences by a const

This commit is contained in:
asus
2024-03-11 00:02:55 +01:00
parent 4f4bfd1c88
commit 046b31579c
11 changed files with 35 additions and 3139 deletions

View File

@@ -15,11 +15,13 @@ if (!defined('ABSPATH')) {
*/
function add_partenaires_PLGNTLS($customer_data){
PLGNTLS_class::debug_infos();
$role_partner = PLGNTLS_class::ROLE_PARTNER;
$current_url = $_SERVER['HTTP_REFERER']; // not reliable to use referer, TODO: find another solution
$path_brut = parse_url($current_url, PHP_URL_PATH);
$path = trim($path_brut, '/');
if ($path === 'creation-du-compte-partenaire')
$customer_data['role'] = 'partenaire';
$customer_data['role'] = $role_partner;
return $customer_data;
}
add_filter( 'xoo_el_register_new_customer_data', 'add_partenaires_PLGNTLS', 10, 1 );