Skip to:
Content
Pages
Categories
Search
Top
Bottom

Detecting if User Uploaded an Avatar

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

  • wp_kouhai
    Participant

    @wp_kouhai

    I have found and corrected the issue.

    function buddypress_redirect_if_no_avatar($redirect_url,$request_url,$user) {
    
      $avatar = bp_core_fetch_avatar( array( 'item_id' => $user->ID, 'no_grav' => true, 'html'=>false) );
    
      $pos = strpos($avatar, 'mystery-man');
      if ($pos === false) { return "/";}
      else {
        $redirect_url = bp_core_get_user_domain($user->ID)."/profile/change-avatar/";
        return $redirect_url;
      }
    
    }
    
    add_filter("login_redirect","buddypress_redirect_if_no_avatar",100,3);

    Lerroy
    Participant

    @lerroy

    Wow this is great thanks


    Lerroy
    Participant

    @lerroy

    Hi Where did you put this in functions file ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Detecting if User Uploaded an Avatar’ is closed to new replies.
Skip to toolbar