Title: Child Plugin
Last modified: February 8, 2024

---

# Child Plugin

 *  Resolved [bastibln](https://wordpress.org/support/users/bastibln/)
 * (@bastibln)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/child-plugin-4/)
 * Hello,
 * for my personal requirements I need to adapt one file in this plugin. Thus, I
   want to copy this php-file to my child theme to make it safe against updates.
   Is there any trick why my previous solution is not working for this plugin?
 * I safed the php-file “class-field-type-from-to.php” under the following path:
 * 
 * Does anyone has a hint here? Thanks a lot.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Ravi Sharma](https://wordpress.org/support/users/raviousprime/)
 * (@raviousprime)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/child-plugin-4/#post-17412775)
 * Hello,
   You can not override plugin files through a child theme. Please let me
   know what you are trying to achieve so I can help.
 *  Thread Starter [bastibln](https://wordpress.org/support/users/bastibln/)
 * (@bastibln)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/child-plugin-4/#post-17415335)
 * Hey,
 * hm okay. Actually it’s just a cosmetical edit, I want the separators to have 
   some space between the numbers. So if a user enters a From-To Value [10,20] I
   want it to be displayed in the frontend like “10 – 20” instead of “10-20”. Thus,
   I just want to add two spaces around the “-” separator. I assume this is not 
   possible via CSS. At least I tried and didn’t manage successfully.
 * Thanks for your support.
    -  This reply was modified 2 years, 8 months ago by [bastibln](https://wordpress.org/support/users/bastibln/).
    -  This reply was modified 2 years, 8 months ago by [bastibln](https://wordpress.org/support/users/bastibln/).
 *  Plugin Author [Ravi Sharma](https://wordpress.org/support/users/raviousprime/)
 * (@raviousprime)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/child-plugin-4/#post-17415516)
 * Hello,
   Use this code in your ‘bp-custom.php’ file.Please try the following code:
 *     ```wp-block-code
       add_filter( 'bp_get_the_profile_field_value', function ( $value, $field_type, $field_id ) {
   
       	if ( 'fromto' === $field_type ) {
       		$user_id = bp_is_user() ? bp_displayed_user_id() : bp_get_member_user_id();
   
       		if ( ! $user_id ) {
       			return $value;
       		}
   
       		$separator = bp_xprofile_get_meta( $field_id, 'field', 'separator_token', true );
       		$separator = empty( $separator ) ? ' - ' : " $separator ";
   
       		$field_value = explode( ',', xprofile_get_field_data( $field_id, $user_id, 'comma' ) );
       		$field_value = array_map( 'trim', $field_value );
   
       		if ( count( $field_value ) !== 2 ) {
       			return $value;
       		}
   
       		$value = sprintf( '<span class="bpxcftr-fromto-from-value">%1$s</span>%3$s<span class="bpxcftr-fromto-to-value">%2$s</span>', $field_value[0], $field_value[1], $separator );
       	}
   
       	return $value;
       }, 10, 3 );
       ```
   
 *  Thread Starter [bastibln](https://wordpress.org/support/users/bastibln/)
 * (@bastibln)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/child-plugin-4/#post-17418385)
 * Wow, thanks a lot for the quick and great help. This works perfectly.
 * Have a wonderful day !
 *  Plugin Author [Ravi Sharma](https://wordpress.org/support/users/raviousprime/)
 * (@raviousprime)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/child-plugin-4/#post-17426509)
 * Thank you for the acknowledgement. I am glad that I could help.

Viewing 5 replies - 1 through 5 (of 5 total)

 The topic ‘Child Plugin’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bp-xprofile-custom-field-types_bd5f1c.
   svg)
 * [BuddyPress Xprofile Custom Field Types](https://wordpress.org/plugins/bp-xprofile-custom-field-types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bp-xprofile-custom-field-types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bp-xprofile-custom-field-types/)
 * [Active Topics](https://wordpress.org/support/plugin/bp-xprofile-custom-field-types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bp-xprofile-custom-field-types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bp-xprofile-custom-field-types/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Ravi Sharma](https://wordpress.org/support/users/raviousprime/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/child-plugin-4/#post-17426509)
 * Status: resolved