Forum Replies Created
-
Thank you for replying, I tried to figure it out on my own, but I cant get it to work. I changed some of the lines, and included what you have, but it breaks the site. (still learning, please bear with me)
function bpfr_hide_profile_field_group( $retval ) { $displayed_user_level = some_s2_function( bp_displayed_user_id() ); if( is_super_admin() && $displayed_user_level == 'access_s2member_level1' ) { // exlude groups, separated by comma $retval['exclude_groups'] = '6,5'; } return $retval; } add_filter( 'bp_after_has_profile_parse_args', 'bpfr_hide_profile_field_group' );
I think I’m close 🙂
I got the field I want to show up on my custom page, but I can’t figure out how to make it edit and submit the changes to the right group. Here’s what I’m using in my custom editing page:
<?php do_action( ‘bp_before_profile_edit_content’ );
if ( bp_has_profile( ‘profile_group_id=’ . bp_get_current_profile_group_id() ) ) :
while ( bp_profile_groups() ) : bp_the_profile_group(); ?><div>
<form action=”<?php bp_the_profile_group_edit_form_action(); ?>” method=”post” id=”profile-edit-form” class=”standard-form my-group”><label for=”field_1″>Custom Field</label>
<input id=”field_1″ type=”text” value=”<?php echo xprofile_get_field_data(‘Custom Field’); ?>” ><?php do_action( ‘bp_after_profile_field_content’ ); ?>
<div class=”submit”>
<input type=”submit” name=”profile-group-edit-submit” id=”profile-group-edit-submit” value=”<?php _e( ‘Save Changes’, ‘buddypress’ ); ?> ” />
</div><input type=”hidden” name=”field_ids” id=”field_ids” value=”29,19,20″ />
<?php wp_nonce_field( ‘bp_xprofile_edit’ ); ?>
</form>
</div>
<?php ?><?php endwhile; ?>
<?php endif; ?>
<?php do_action( ‘bp_after_profile_edit_content’ ); ?>
I’ve decided to try and put the fields in a separate custom editing page, and I’m searching for how to add each extended editable input xprofile field individually, with their id number. I think that will help solve the styling issue. I’ve been searching for something similar like this so I can see how to accomplish this, if anyone can suggest something I would greatly appreciate it! 🙂
Thank you so much! Yep it works 🙂
Hi, thanks shanebpx, I didn’t understand what Hugo was saying (I only know a very small amount of php), but now I can see from your post what he meant. Will try to figure it out. Thank you for all your help!
Thanks for your reply. I think I may be asking the wrong thing. I would like to hide everything in the divs if there isn’t any user latest activity posted, so I thought that if I used: if this, then show the divs, if not, then show nothing. But I dont know how to write it. Sorry for the confusion.
Thanks added it here: https://gist.github.com/4290064
Thanks Hugo, can you show how to write it, sorry I’m a newbie