Major changes to Edit.php
-
Hi
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' ); ?>> <?php $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() ); $field_type->edit_field_html(); /** * Fires before the display of visibility options for the field. * * @since 1.7.0 */ do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); ?> <?php /** * Fires after the visibility options for a field. * * @since 1.1.0 */ do_action( 'bp_custom_profile_edit_fields' ); ?> </div> <?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)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Major changes to Edit.php’ is closed to new replies.