How can I set a role to a user by a button click?
-
Hi, I’m having a bit trouble to set a role to a user by a button-click.
I created a pop up that appears in the store page with two buttons:
Button-1: on click close the pop up;
Button-2: on click user set his own role.So, I acctualy have two dead end:
1 – It’s possible to set a role to a guest-user?
2 – I’m not sure if I’m making it right:I’ve created a HTML button with an ID;
<button id="b2" onclick="profissional()">Sou profissional de beleza </button>
Then add The function onclick;
<script> function profissional() { location.href = '/wp-includes/teste-teste.php'; } </script>
And, inside the PHP file, the follow code:
`<?php
um_fetch_user( 25 );
$ultimatemember->user->set_role(‘um_profissional-de-beleza’);
?>Regards,
Fernando
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How can I set a role to a user by a button click?’ is closed to new replies.