BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on in reply to: [Resolved] Redirect user if not member type #10085

    Great, it works well.
    Thank you very much Brajesh.

    Ahmed

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on in reply to: [Resolved] Redirect user if not member type #10081

    Yes, ‘particulier’ is the only member type I want redirect.

    Ahmed.

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on in reply to: [Resolved] Redirect user if not member type #10078

    thank you for help Brajesh,

    Here is the function

    function yoostart_restriction() {
      if ( ! is_user_logged_in() && is_page('devenir-vendeur') ) {
        wp_redirect( home_url( '/test') );
      }
    
      $member_type = bp_get_member_type( bp_loggedin_user_id() );
    
      if ( empty( $member_type ) && is_page('devenir-vendeur') ) {
        wp_redirect( home_url( '/test') );
      }
    
      if( 'particulier' === $member_type && is_page('devenir-vendeur') ) {
        wp_redirect( home_url( '/test') );
      } 
    }
    add_action( 'bp_template_redirect', 'yoostart_restriction' );
    

    and it works well,can be improved?

    Ahmed

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on in reply to: [Resolved] Redirect user if not member type #10063

    hi Brajesh,
    i try 2 ways

    1st way:

    function yoostart_restriction(){
    if ( bp_has_member_type( bp_loggedin_user_id(), ‘particulier’) && is_page(‘devenir-vendeur’) ) {
    wp_redirect( home_url(‘/test’) );
    }
    }
    add_action(‘bp_template_redirect’, ‘yoostart_restriction’);

    This function works but doesn’t take users without member type.

    2nd way:

    function yoostart_restriction(){

    $member_type = bp_get_member_type( $current_user->ID );

    if (is_user_logged_in() && ‘microentreprise’ === $member_type && is_page(‘devenir-vendeur’) ) {
    wp_redirect( home_url( ‘/test’) );
    }
    }
    add_action(‘bp_template_redirect’, ‘yoostart_restriction’);

    I wanted to use variable but it doesn’t work

    thank you
    Ahmed

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on in reply to: [Resolved] favorite icone #10019

    Hi Brajesh,
    Thank you, I will contact theme.

    Ahmed

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on in reply to: [Resolved] Display member type profile by color #9866

    thank you

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on in reply to: [Resolved] Display member type profile by color #9863

    sorry Brajesh, one more question, if i want to add this class in member directory, how i do that?

    • This reply was modified 6 years, 8 months ago by Ahmed.
  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on in reply to: [Resolved] Display member type profile by color #9862

    thank you very much Brajesh.

    I’m looking forward to the update.
    you do a great job, bravo

    Ahmed.

  • Participant
    Level: Enlightened
    Posts: 26
    Ahmed on in reply to: [Resolved] Display member type profile by color #9851

    I’m not expert but yes 👍