Skip to:
Content
Pages
Categories
Search
Top
Bottom

Check value of profile field ā€“ displaying images instead


  • Divvy
    Participant

    @divvy

    Hello,

    Is it possible to check if a custom profile field (checkbox) value is x, y, and z. My purpose for this is to display a corresponding image for each possible choice, in user profile and under user avatar in bbpress.

    Example:

    Male: male symbol image
    Female: female symbol image
    Couple: male+female symbols image

    Iā€™m sure others would be looking for such a snippet like I was.

    Cheers

    I have found this code:

    $some_field = bp_get_member_profile_data( 'field=Name of Field' );
    if( !empty( $some_field ) ) {
         if( $some_field == 'x') 
            echo 'x'; 
         elseif( $some_field == 'y') 
            echo 'y'; 
         else
            echo 'z'; 
    }

    But for some reason, is not working… and it seems that is for profile page only…

    Help šŸ™‚

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