Skip to:
Content
Pages
Categories
Search
Top
Bottom

Profile Fields – Hide on edit profile


  • enlightenmental1
    Participant

    @enlightenmental1

    added additional fields to profile/registration:

    “referred by:”

    so users can enter the member that referred them to the site…

    I want this hidden on the edit profile section so the user can only enter/change this information once from the registration page…

    i.e.

    on the registration page, the “referred by” can be filled out

    on the edit-profile page, the “referred by” is read only / disabled

    thanks for the input

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

  • nicolagreco
    Participant

    @nicolagreco

    It can’t be done right now, but you can do that making a plugin sure

    Nicola


    enlightenmental1
    Participant

    @enlightenmental1

    Hey Nicola,

    I don’t mean to disagree with you, and Im sure you know more than me, but I think this IS possible….I’ve done it on other WP installs

    once the extra profile fields are created, I just need a way to call them back.

    (I realize I would be removing the “get additional fields” function and just code it by hand)

    For example if I wanted to display the users first name, I would use this:

    Register Page:

    <input type="text" name="first_name" id="first_name" class="input" value="" size="25" tabindex="20" /></label>

    Profile Page:

    <input type="text" name="first_name" id="first_name" class="input" value="<?php echo $_GET['first_name']; ?>" size="25" tabindex="20" READONLY=READONLY /></label>

    so rather than displaying the form fields dynamically(x_profile), I would just hand code them in based on what “extra fields” I’ve created

    that will work won’t it?

    I just need to know which files to modify….

    thanks for brainstorming with me


    nicolagreco
    Participant

    @nicolagreco

    “you can do that making a plugin sure”

    i said :D

    For plugins i mean doing the thing you’ve thought


    enlightenmental1
    Participant

    @enlightenmental1

    I see, I see… thanks

    by “make plugin” you mean just handcode what i want….

    can you tell me which files to edit:

    wp-signup.php

    (edit this to add extra fields to registration once I remove x_profile functionality)

    how about the “edit profile” page?

    which PHP file is that?

    I still need to display those fields as “readonly”

    thanks again


    Burt Adsit
    Participant

    @burtadsit

    You’ll have to modify the member theme functions that display the fields in the profile. That gets generated in: /buddypress-member/profile/profile-loop.php

    by the function: bp_the_profile_field_value() in /mu-plugins/bp-xprofile/bp-xprofile-templatetags.php

    There’s a filter in there that you can hook: echo apply_filters( ‘bp_the_profile_field_value’, $field->data->value, $field->type, $field->id );

    So that you can detect these specific fields and change what gets generated by bp.


    enlightenmental1
    Participant

    @enlightenmental1

    I think i understand what you mean…. well… not really

    function bp_the_profile_field_value() {

    global $field;

    $field->data->value = bp_unserialize_profile_field( $field->data->value );

    echo apply_filters( ‘bp_the_profile_field_value’, $field->data->value, $field->type, $field->id );

    }

    you’re saying add a “if” statement, so if the “x_profile fields = this” do “this”…..

    I dont know enough about php….


    enlightenmental1
    Participant

    @enlightenmental1

    it appears the profile fields are being named rather generically…

    i.e.

    field_1

    (first name)

    field_2

    (xprofile field #1)

    field_3

    (xprofile field #2)

    I need a way to manually call/insert these values… and Im assuming they aren’t named “field_3” in the database

    I was hoping if i add an extra field and call it “Referred by” that the DB table name would be “referred_by”

    this this a correct presumption?

    I have little knowledge of functions and this code has ALOT of them….


    bingoneighbour
    Participant

    @bingoneighbour

    Actually it’s pretty easy to see what profile fields are called in the DB – Check the wp_bp_xprofile_fields table and you’ll have an ID associated with each field which you should be able to use to call them.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Profile Fields – Hide on edit profile’ is closed to new replies.
Skip to toolbar