Modify profile edit page
I’ve been creeping around these forums for a few days, but I’m unable to find a post that explains what I’m looking for in any decent detail.
I’m trying to remove one of the xprofile fields from the edit page. My end goal is to limit what fields may be modified by the user, based on their membership level using s2membership. I feel if I can figure out how to hide one field, I’ll be able to go from there.
Now I have found a few posts describing this same action, but the responses seem very vague. What I’ve been trying to do is modify the edit.php file in the “wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile” directory. I realize that modifying the core files is not the best practice, and this will be replaced with the next buddypress update, but I also have not found a detailed explanation on the proper way to edit these files, so I’m sticking with this for the moment just to see if I can get it working.
I see there is a while loop in this file, and it looks like it iterates for each element in an array containing all of the profile fields. Each iteration grabs the fields type as a string, and compares it to a list of valid options. When a match is found, it performs some html/php magic, and adds a field on the screen to be modified. (php and html are new to me. I am familiar with c++, java, and c#)
modified snippet from file:
<?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> <div<?php bp_field_css_class( 'editfield' ); ?>> <?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?> *html/php magic* <?php endif; ?> </div> <?php endwhile; ?>
No matter what edits I make to this file, it does not seem to change anything.
Any information would be great, and I appreciate your time. Thank you.
- You must be logged in to reply to this topic.