Skip to:

Major changes to Edit.php

  • ch1n3s3b0y



    I’m changing the profile edit form on the front end. What I am trying to do is:

    • List each field where I want rather than BP just looping through each profile field
    • I want to be able to customise the classes for the fields as I am using Twitter Bootstrap

    Currently I have to this to loop through the fields and only show the field I want where I want it:

    <?php while ( bp_profile_fields() ) : bp_the_profile_field();
    					if ( bp_get_the_profile_field_id() == 3 ) : ?>
    					<div<?php bp_field_css_class( 'editfield' ); ?>>
    						$field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() );
    						 * Fires before the display of visibility options for the field.
    						 * @since 1.7.0
    						do_action( 'bp_custom_profile_edit_fields_pre_visibility' );
    						 * Fires after the visibility options for a field.
    						 * @since 1.1.0
    						do_action( 'bp_custom_profile_edit_fields' ); ?>
    				<?php endif;endwhile; ?>

    Is there a better way to do this? It seems inefficient to loop through every profile field just to get one?

    Also, how can I add classes to the HTML output and/or completely change that output if I want?

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

  • shanebp


    You could let it loop thru the fields and then ‘View Source’ or equivalent in the browser and copy / paste the output.
    If you do, be sure to adjust value in this line to reflect the field ids that you actually use:
    <input type="hidden" name="field_ids" id="field_ids" value="2,8,4464" />



    I’m probably misunderstanding the question but for the first part (“List each field where I want”) are you trying to control the order the fields appear to a user on this page?

    If so, have you already tried reordering them in admin panel -> users -> profile fields ?




    Thanks for the responses. I have just copied and pasted the output. I had done this before and it had worked fine. The reason I was trying to do it more like the way the vanilla BP works is due to TinyMCE not working when I copy and paste it, but I can live with just a normal text area. Thanks for the help 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Major changes to Edit.php’ is closed to new replies.
Skip to toolbar