Skip to:
Content
Pages
Categories
Search
Top
Bottom

conditional statement based on a returned field value outside of loop

  • @mistwist

    Member

    I need to make a conditional statement based on a returned field value OUTSIDE of the profile loop.

    If I do it like this:
    if (bp_profile_field_data(‘field=gender’)) == “female”{
    do this…
    }

    it returns the value of the field only and not the “do this…” part

    Suggestions?

Viewing 8 replies - 1 through 8 (of 8 total)
  • @hnla

    Participant

    It would be more like this:

    if (bp_get_profile_field_data(‘field=thefield’) == ‘string’) :

    @mistwist

    Member

    I thought I had tried that. :(

    Thank you very much, works perfectly now!

    @onyx808

    Participant

    @hnla its only working on the profile page… but not in the other pages… any idea how to get it to work on all pages?

    @onyx808

    Participant

    Sorry actually works on all pages but the activity page…not sure why is not working in the activity page… ;(

    @onyx808

    Participant

    @DJPaul any idea why this would not work on the activity page?

    `

    `

    @djpaul

    Keymaster

    I think you’ll need to pass the user_id, too.

    @onyx808

    Participant

    @DJPaul any idea of how to pass the user id too? I been trying but fail so far…
    tried `&user_id=’ . bp_displayed_user_id()` `global $bp;` `bp_is_member()`….. nothing seems to work =(

    @gregfielding

    Participant

    @onyx808
    Did you ever figure this out? I’m trying to do the same thing…

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘conditional statement based on a returned field value outside of loop’ is closed to new replies.
Skip to toolbar