sanjaynakate (@sanjaynakate)

Forum Replies Created

Viewing 1 replies (of 1 total)

  • sanjaynakate
    Participant

    @sanjaynakate

    Finally i have got the answer.
    Bellow are the step.
    1) Get user current user id.

    <?php $user_id = get_current_user_id(); ?>

    2)set new user forum role you wish to change

    <?php $new_role_forum_role="bbp_participant"; ?>

    3)fire function.

    <?php bbp_set_user_role( $user_id, $new_role_forum_role );?>

    now check your user in back end and see forum user role.

    Full snippet code

    <?php
    $user_id = get_current_user_id();
    $new_role_forum_role=”bbp_participant”;
    bbp_set_user_role( $user_id, $new_role_forum_role );
    ?>

Viewing 1 replies (of 1 total)