Replies
- This reply has been marked as private.
- Brajesh Singh on May 31, 2022 at 10:57 am in reply to: Apply Filter to Xprofile Value Prior to Display of User Profile #45144
Hi Quint,
Thank you for the reply and confirming.2. I have slightly updated the code( Also included your code for inch2feet, so please remove the old one).
function inches2feet($inches){ //Get the feet by dividing the inches by 12. $feet = intval($inches/12); //Then, get the remainder of that division. $inches = $inches % 12; //If there is no remainder, then it's an even figure if($inches == 0){ return $feet . ' foot'; } //Otherwise, return it in ft and inches. return sprintf('%d ft %d inches', $feet, $inches); } /** * Converts inches to metric unit(zz meters, xx cms ). * * @param float $inches inch. * * @return string */ function inches2metric( $inches ) { $cms = $inches * 2.54; $len_meters = floor( $cms / 100 ); $len_cms = $cms % 100; $out = array(); if ( $len_meters ) { $out [] = sprintf( '%d meters', $len_meters ); } if ( $len_cms ) { $out [] = sprintf( '%d cm', $len_cms ); } return join( ', ', $out ); } add_filter( 'bp_get_the_profile_field_value', function ( $field_value, $field_type = '', $field_id = '' ) { if ( ! $field_id || ! $field_value ) { return $field_value; } $height_fields = array( 8, 9 );// update your field ids. if ( ! in_array( $field_id, $height_fields ) ) { return $field_value; } $field_value = floatval( $field_value ); $imperial_length = inches2feet( floatval( $field_value ) ); $metric_length = inches2metric( $field_value ); return "{$imperial_length}({$metric_length})"; }, 9, 3 );It will display in the format ” xx ft, yy inch( mm meters, zz cms)”.
Please feel free to adapt it.3. Thank you. I do believe that.
Sure, I am looking forward to it.
Regards
Brajesh - Brajesh Singh on May 30, 2022 at 9:22 pm in reply to: Apply Filter to Xprofile Value Prior to Display of User Profile #45142
Hi Quint,
Welcome back.1. You can apply it to multiple fields in the profile loop using a filter
add_filter( 'bp_get_the_profile_field_value', function ( $field_value, $field_type = '', $field_id = '' ) { if ( ! $field_id || ! $field_value ) { return $field_value; } $height_fields = array( 8, 9 );// update your field ids. if ( ! in_array( $field_id, $height_fields ) ) { return $field_value; } return inches2feet( floatval( $field_value ) ); }, 9, 3 );2. Do you want me to update to append the original value. If yes, what would be the display format.
3. Thank you for the suggestion and I am surely considering adding a length field.
Regards
Brajesh - Brajesh Singh on May 30, 2022 at 8:24 pm in reply to: BuddyPress Auto Friendship Pro + BuddyPress Featured Members Feature Suggestion #45141
Hi Tosin,
Thank you. I will be getting back to you late this weekend with more details.Regards
Brajesh - Brajesh Singh on May 30, 2022 at 7:58 pm in reply to: User Profile Tab Pro: Link configuration & Icon Selection #45140
Hi April,
Thank you for the details.I do not understand your point but I do understand that you want the link to be /members/xyz/first-name for xyz user.
At the moment, the plugin does not have this ability. We can add it in next 2-3 days via hook. We will not add this to plugin core as it does not represent our intended use case and will be more trouble for most of the members who do not understand how BuddyPress/BuddyBoss works(You seem to know, so that does not apply to you).
Regards
Brajesh - Brajesh Singh on May 30, 2022 at 12:00 pm in reply to: BuddyPress Group Tabs Creator Pro upgrade issue #45134
Hi David,
I am sorry. I am not sure what could be the cause as you do have active membership. Do you have any staging site where I can check the same?Regards
Brajesh - Brajesh Singh on May 30, 2022 at 11:52 am in reply to: BuddyPress User Badges – Editing profiles to add custom badge triggers PW reset #45133
Thank you. I am looking forward to your feedback.
- Brajesh Singh on May 30, 2022 at 11:52 am in reply to: User Profile Tab Pro: Link configuration & Icon Selection #45132
Hi April,
Welcome back.1. Sorry, that is beyond the scope of profile tabs creator pro. It can not help you with your profile url. That is provided by BuddyPress/BuddyBoss. It can help you with the component url(e.g friends/activity/messages etc). The url format http://example.com/members-directory-page-slug/user-nicename/user_login is managed by the BuddyPress/BuddyBoss core.
I will suggest contacting BuddyBoss developers if you need to change that.
2. Does BuddyBoss offer you to choose icons for tab? If yes, Please let me know and we can add the same. Otherwise, the solution is to add icon via css. Please let me know the icon code and I will supply the css.
Regards
Brajesh - Brajesh Singh on May 30, 2022 at 11:46 am in reply to: BuddyPress Auto Friendship Pro + BuddyPress Featured Members Feature Suggestion #45131
Hi Tosin,
Thank you for the suggestion.can you please tell the intent on the request. Do you want new user to be friends with all the feature members or do you want the user who is being featured to be friends with other member matching the criteria?
Regards
Brajesh - Brajesh Singh on May 30, 2022 at 8:54 am in reply to: [Resolved] “BuddyPress User Badges” Update for BuddyBoss 2 #45128
Hi @talia,
Sorry about it.Please open a new topic to help me assist you. This topic is related to another member’s issue and they will be notified of the discussions which is not relevant to their need.
In the meantime, I will be looking at the issue.
Regards
Brajesh