Skip to:
Content
Pages
Categories
Search
Top
Bottom

User Role


  • Kalusha
    Participant

    @kalusha

    Hey,

    I want that every User from my Site who is an “Autor”, must be in my Forum as an Spectrator. Is it possible with an function?

    best regards

Viewing 16 replies - 1 through 16 (of 16 total)

  • Kalusha
    Participant

    @kalusha

    My Problem is already there 🙁

    When this is not possible it were also ok when I had a function which says…

    Every “Autor” is show in my WordPress Forum as an “Premium User”.

    Hope anybody can help me…


    Kalusha
    Participant

    @kalusha

    I thing anything like this…

    function my_custom_roles3( $role, $user_id ) {
    if( $role == ‘Author’ )
    return ‘***Premium User***’;

    return $role;

    }

    add_filter( ‘bbp_get_user_display_role’, ‘my_custom_roles3’, 10, 2 );


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Use the bbp_get_user_role_map filter, to map WordPress roles to bbPress roles.


    Kalusha
    Participant

    @kalusha

    thank you for the tip.

    Can you please give me the function…

    It doesn´t work so.

    best regards


    Kalusha
    Participant

    @kalusha

    Can you please help me with that???

    PLEASE


    Kalusha
    Participant

    @kalusha

    No,

    can you help me?


    Robin W
    Moderator

    @robin-w

    try this – it should work but is untested

    Please come back and let us know if it does or doesn’t

    add_filter ('kal_get_user_role_map()' , 'bbp_get_user_role_map()' ) ;
    
    function kal_get_user_role_map() {
    
    	// Get the default role once here
    	$default_role = bbp_get_default_role();
    
    	return (array) apply_filters( 'kal_get_user_role_map', array (
    		'administrator' => bbp_get_keymaster_role(),
    		'editor'        => $default_role,
    		'author'        => bbp_get_spectator_role(),
    		'contributor'   => $default_role,
    		'subscriber'    => $default_role
    	) );
    }

    This goes in your function file


    Kalusha
    Participant

    @kalusha

    Thank you but it doen´t change anything…

    Other idea?


    Robin W
    Moderator

    @robin-w

    it would only apply to new users.


    Robin W
    Moderator

    @robin-w

    you can use the bulk action in dashboard>users to change current ones


    Kalusha
    Participant

    @kalusha

    I have try it but bulk action doesn´t work.

    Maybe you can take a look on my Site?


    Robin W
    Moderator

    @robin-w

    Maybe you can take a look on my Site?

    sorry that is beyond free support.

    I have try it but bulk action doesn´t work.

    can you say what didn’t work – some detail would be useful


    Kalusha
    Participant

    @kalusha

    bulk

    After I make Bulk aktion nothing change.

    On the Picture you can see the Situation better.

    With Bulk Action were it perfect. But it doesn´t work.

    Hope you can help me?!?!


    Kalusha
    Participant

    @kalusha

    Hello again,

    can anybody give me a function that a spectator have the same capability as a participant.

    Please


    Kalusha
    Participant

    @kalusha

    OK, I have tried it with this…

    add_filter( ‘bbp_get_dynamic_roles’, ‘ntwb_bbpress_custom_role_names’ );

    function ntwb_bbpress_custom_role_names() {
    return array(

    // Participant
    bbp_get_participant_role() => array(
    ‘name’ => ‘Standard User’,
    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() )
    ),

    // Spectator
    bbp_get_spectator_role() => array(
    ‘name’ => ‘–>Premium User<–‘,
    ‘capabilities’ => bbp_get_caps_for_role( bbp_get_participant_role() )
    )
    );
    }

    I can now change every User to a “Standard User” or “Premium User”. That is what I want, BUT with the Premium User I can not write any replies or others. With the Standard User is everything ok.

    Where is the mistake???


    Kalusha
    Participant

    @kalusha

    Here I have found why the bulk action don´t work

    Bulk action in >>Users Change Forum Role doesn’t work

    Now I have change all Users with bulk action.

    Thank you

Viewing 16 replies - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.
Skip to toolbar