Support » Plugin: User Profile Picture » Need to check whether profile pic is set or not.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ronald Huereca

    (@ronalfy)

    That’s strange. If you set the echo argument to false, it should return the thumbnail if it exists and false if it doesn’t. Have you tried that?

    You can also do what is inside the mt_profile_img for checking for the profile pic.

    It’s basically:

    $profile_post_id = absint( get_user_option( 'metronet_post_id', $user_id ) );

    if( !has_post_thumbnail( $profile_post_id ) ) {
    //do something
    }

    Plugin Author Ronald Huereca

    (@ronalfy)

    BTW, you can set the echo argument to false via this route:

    //Assume $user_id is set
    $profile_pic = mt_profile_img( $user_id, array( 'echo' => false ) );
    if ( !$profile_pic ) {
      //do stuff
    }

    Thanks for the information. Exactly this is what i was looking for.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Need to check whether profile pic is set or not.’ is closed to new replies.