Thursday 15 March 2012

in wordpress 4.0 with buddypress how do I add a profile field that can only be changed by administrators -



in wordpress 4.0 with buddypress how do I add a profile field that can only be changed by administrators -

i running club-based wordpress application. in has buddypress installed it.

what want do, add together profile field value can set administrator of site. know how add together custom field, default behavior allow user set it. don't want that.

can done, , if so, how? give thanks you.

create template overload of file: buddypress\bp-templates\bp-legacy\buddypress\members\single\profile\edit.php

untested, seek changing this:

$field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() ); $field_type->edit_field_html();

to this:

$name = bp_get_the_profile_field_name(); if( $name == 'name of field' ) { if( is_super_admin() ) { $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() ); $field_type->edit_field_html(); } else echo $name . '<br/>' . bp_get_the_profile_field_value(); } else { $field_type = bp_xprofile_create_field_type( bp_get_the_profile_field_type() ); $field_type->edit_field_html(); }

wordpress

No comments:

Post a Comment