Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_profile_field_data( ‘field= … doesn’t work

Viewing 21 replies - 1 through 21 (of 21 total)
  • @rogercoathup

    Participant

    Try bp_member_profile_data() instead.

    The documentation in the code is incorrect and as you’ve noticed bp_profile_field_data() doesn’t work for the complex data types.

    @pjnu

    Participant

    Hmm. I tried it but nothing shows up.

    @modemlooper

    Moderator

    When the stored data is an array you have to process it

    `$arr = bp_get_profile_field_data( ‘field=’ );

    foreach ($arr as $value) {
    echo “Value: $value
    n”;
    }`

    @rogercoathup

    Participant

    @modemlooper – the new function I’ve given handles array data types, so you don’t have to write any of your own conditional code to catch and process array types.

    You should switch your code to use bp_member_profile_data()

    @rogercoathup

    Participant

    @PJ – not sure why the function isn’t working for you — have you got the field name correct?

    Paste your code in this thread, and someone might be able to spot what you are doing wrong.

    @andrewgtibbetts

    Participant

    I also am getting nothing with bp_profile_field_data. It is spitting out the values in my regular theme’s member-header.php but when I plunk it into the BPMobile theme, nothing. Any ideas?

    @modemlooper

    Moderator

    Paste code your using

    @rogercoathup

    Participant

    @andrewgtibbets — try the function I’ve suggested in the thread: bp_member_profile_data()

    @andrewgtibbetts

    Participant

    bp_profile_field_data(‘field=Company’); works in my desktop theme, not in mobile. I tried bp_member_profile_data(‘field=Company’);, still nothing.

    @modemlooper

    Moderator

    I’ll test it

    @andrewgtibbetts

    Participant

    Holy shitake mushrooms…I’m an idiot. The user I’m working with didn’t have any values in any of the fields. Please ignore. Keep moving. Nothing to see here.

    @mlabrooy

    Participant

    Hi I am trying to display members telephone#s in the members directory using bp_profile_data_field and I was able to get the email but I was not able to get the telephone number for some reason.
    I used bp_member_profile_data(‘field=31’); which I made under user profile fields.
    But it still did not work. For the email I used the same exact syntax bp_member_profile_data(‘field=30’) and it worked for me.But the phone number I am having trouble with.
    Any advise on how to do this would be helpful.

    Running the latest version of WP/BP

    @mlabrooy

    Participant

    Bump

    Can anyone give me any insight on this?

    @mlabrooy

    Participant

    Can anyone give me some insight into getting phonenumber to display using bp_profile_field_data() within member-loop.php

    It does not work for me.

    @mlabrooy

    Participant

    Can one of the moderators help out please.

    @valuser

    Participant

    not a moderator just a Participant

    Try

    Where Phone Number is an xprofile field

    put the code at http://pastebin.com/Zb12M7cz in your members-loop.php

    @mlabrooy

    Participant

    @valuser Thanks for the reply. But it still does not work.
    Someone said to try this, but it does not work for me. Any reason to why do you know?

    <?php echo 'phone: ‘; ?>

    Thanks

    @valuser

    Participant

    I have presumed that Phone Number is the exact name of your Profile field. Is it ?

    @mlabrooy

    Participant

    It is Telephone #.
    Ooh for some reason my code didnt show up.

    <?php echo 'phone: ‘; ?>

    @mlabrooy

    Participant

    And I also tried switching Phone Number with Telephone # in the function and still does not work.

    @henrywright-1

    Member

    You will hit problems if you edit the data type of a field once data is stored in the db. e.g changing a text field to a checkbox will cause problems with the documented code as you need to process the array (as @modemlooper pointed out).

    The easy way around changing the type of an existing field is to delete field and create a new one (don’t ‘edit’ it).

Viewing 21 replies - 1 through 21 (of 21 total)
  • The topic ‘bp_profile_field_data( ‘field= … doesn’t work’ is closed to new replies.
Skip to toolbar