Rename Field Label Depending On Member Type
-
I am trying to get around different fields being required in different member types, by trying to change the label of the field for a specific member type
When using the following code, it changes the name of the field, and not just the label!
Any Tips, please.
I have it visible to all users, and will display in the backend as Cost Per Hour when it is edited (shows the other name when not edited).function filter_bp_get_the_profile_field_name( $field_name ) { // make filter magic happen here... $user_id = bp_loggedin_user_id(); $bp_user_member_type = bp_get_member_type($user_id); // field name (case sensitive) // if ($bp_user_member_type == 'parent' ) { if( $field_name == 'Cost Per Hour') { $field_name = 'Maximum Amount To Pay For Sitting'; //var_dump($field_name ); //die("filter_bp_get_the_profile_field_name"); } // } return $field_name; }; // add the filter add_filter( 'bp_get_the_profile_field_name', 'filter_bp_get_the_profile_field_name', 10, 1 );
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.