Title: Some issues
Last modified: August 21, 2016

---

# Some issues

 *  Resolved [Andres Felipe](https://wordpress.org/support/users/naturalworldstm/)
 * (@naturalworldstm)
 * [13 years ago](https://wordpress.org/support/topic/some-issues-5/)
 * Hi and thanks for this excellent plugin. I’m using it a few hours ago and have
   some doubts:
 * 1. Is it possible to link the Website field to a blank new page? Currently is
   leaving the people outside my site when clicking on some website field.
    2. After
   activate it, the privacy options for the fields added for the plugin appearse
   over the field name in front-end. The privacy remains working for that field 
   but appears over the field name and below last field privacy option. Any idea?
   3. For birthday field I’m trying to show only day and month, not year. I’m following
   a current topic with another user and have the same problem, it’s showing the
   current day. 4. In order to keep the things ok until at least the privacy option
   issue be solved, can I deactivate the plugin without lose the fields associated
   with this plugin? 5. Is it possible in “custom post” field to make it clickable?
   I want people choose one of this and when save it, people who can see it can 
   click on it and go to that custom post page.
 * Thanks for your time and sorry for my english!
 * [http://wordpress.org/extend/plugins/buddypress-xprofile-custom-fields-type/](http://wordpress.org/extend/plugins/buddypress-xprofile-custom-fields-type/)

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

 *  Plugin Author [donmik](https://wordpress.org/support/users/atallos/)
 * (@atallos)
 * [13 years ago](https://wordpress.org/support/topic/some-issues-5/#post-3680964)
 * Hi,
 * I have just updated my plugin to add a new filter. Now you can use this filter
   to change the way it shows the field value. The filter name is bxcft_show_field_value.
   So to customize, birthdate, website or custom post type do it adding this filter
   in your functions.php:
 *     ```
       add_filter( 'bxcft_show_field_value', 'my_show_field', 15, 4);
       function my_show_field($value, $type, $id, $value_to_return) {
       if ($type == 'birthdate') {
               $value = str_replace("<p>", "", $value);
               $value = str_replace("</p>", "", $value);
               $field = new BP_XProfile_Field($id);
               // Get children.
               $childs = $field->get_children();
               $show_age = false;
               if (isset($childs) && $childs && count($childs) > 0) {
                   // Get the name of custom post type.
                   if ($childs[0]->name == 'show_age')
                       $show_age = true;
               }
               if ($show_age) {
                   return '<p>'.floor((time() - strtotime($value))/31556926).'</p>';
               }
               return '<p>'.date_i18n( 'F j' , strtotime($value) ).'</p>';
           } elseif ($type == 'web') {
               if (strpos($value, 'href=') === false) {
                   $value = str_replace("<p>", "", $value);
                   $value = str_replace("</p>", "", $value);
                   return '<p><a href="'.$value.'" target="_blank">'.$value.'</a></p>';
               } else {
                   $value = str_replace('href=', 'target="_blank" href=', $value);
                   return $value;
               }
           } elseif ($type == 'select_custom_post_type') {
               $value = str_replace("<p>", "", $value);
               $value = str_replace("</p>", "", $value);
               // Get children.
               $field = new BP_XProfile_Field($id);
               $childs = $field->get_children();
               if (isset($childs) && count($childs) > 0) {
                   // Get the name of custom post type.
                   $custom_post_type = $childs[0]->name;
               }
               $post = get_post($value);
               if ($post->post_type == $custom_post_type) {
                   return '<p><a href="'.  get_permalink($post->ID).'">'.$post->post_title.'</a></p>';
               } else {
                   // Custom post type is not the same.
                   return '<p>--</p>';
               }
           }
   
           return $value_to_return;
       }
       ```
   
 * The first if is the same if for birthdate, it must show the birthdate without
   year. If it does not work, try to var_dump($value); and we will see what value
   is contained. If it is empty there is a problem when saving birthdate.
 * The second if is for website. I’ve added a target=”_blank”.
 * The third id is for custom post type. I’ve added a link to permalink of post.
 * All this code answer to 1, 3 and 5.
 * 2. Can I see a picture of what are you saying about privacy options or maybe 
   you can send me a link to see for myself.
 * 4. No, you cannot deactivate plugin, the fields won’t disappear but the users
   can still see them when they edit their profile and while this plugin is deactivated,
   they will show the fields as textboxes. So you can have some errors.
 * No problem!
 *  Thread Starter [Andres Felipe](https://wordpress.org/support/users/naturalworldstm/)
 * (@naturalworldstm)
 * [13 years ago](https://wordpress.org/support/topic/some-issues-5/#post-3681025)
 * 1,3,5. Are You serious??? You’re awesome!!! that code works like a charm!!!
 * 2. You can see it [here](http://test.quehaypahacer.com/) with demo, demo. [This is a capture](https://dl.dropboxusercontent.com/u/60768679/privacy%20option.jpg).
 * 4. Nevermind, now I don’t want to deactivate the plugin. Is excellent!!!
 * atallos, thanks for all your time and hard work!!!
 * P.S.: Where can I send You a correction for the es_ES file? actually is just 
   one word than remains in English “Nobody” to “Solo yo” or “Nadie”, I think is
   better “Solo yo”.
 *  Plugin Author [donmik](https://wordpress.org/support/users/atallos/)
 * (@atallos)
 * [13 years ago](https://wordpress.org/support/topic/some-issues-5/#post-3681030)
 * For the privacy options, you were right. I thought I solved this in one of the
   latest updates but I was wrong. Now I think it will work. The only problem is
   what i was saying in other thread, the description of the field will still appear
   after the privacy options, you need to change this manually in your templates.
   I cannot do anything in my plugin to change the position of the description of
   field.
 * I’ve added what you say about the spanish translation. Thanks for your advice!
 *  Plugin Author [donmik](https://wordpress.org/support/users/atallos/)
 * (@atallos)
 * [13 years ago](https://wordpress.org/support/topic/some-issues-5/#post-3681031)
 * I’ve uploaded a new version 1.5.5.1 and the code I’ve posted here will not work,
   you only need to change this:
 * `function my_show_field($value, $type, $id, $value_to_return) {`
 * with this:
 * `function my_show_field($value_to_return, $type, $id, $value) {`
 * You only need to swap the position of $value_to_return and $value and it should
   work. If not, get in touch and I take a look.
 *  Thread Starter [Andres Felipe](https://wordpress.org/support/users/naturalworldstm/)
 * (@naturalworldstm)
 * [13 years ago](https://wordpress.org/support/topic/some-issues-5/#post-3681039)
 * Hi atallos
 * After update and changing this line, everything is ok.
 * For the privacy options the problem remains, I tried to make the change You suggested
   in another topic and when I changed that line, the privacy option place is ok
   but if I want to change from say friends to anyone, when I click in change, the
   whole field dissapear.
 * For the record I’m still in BP 1.6.x, I’ll update BP later today and check again
   if the privacy option has been changed.
 *  Thread Starter [Andres Felipe](https://wordpress.org/support/users/naturalworldstm/)
 * (@naturalworldstm)
 * [13 years ago](https://wordpress.org/support/topic/some-issues-5/#post-3681065)
 * If someone is reading this, with 1.5.5.3 everything is working excellent with
   1.6.x or 1.7!!!
 * Thanks a lot atallos!!!
 *  Thread Starter [Andres Felipe](https://wordpress.org/support/users/naturalworldstm/)
 * (@naturalworldstm)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/some-issues-5/#post-3681156)
 * Hi Atallos
 * Since I don’t know wich update, the position of privacy option is again in the
   wrong place. This is a capture how it looks now [https://dl.dropboxusercontent.com/u/60768679/privacy.jpg](https://dl.dropboxusercontent.com/u/60768679/privacy.jpg)
 * In 1.5.5.3 it was ok with this code:
 *     ```
       add_filter( 'bxcft_show_field_value', 'my_show_field', 15, 4);
       function my_show_field($value_to_return, $type, $id, $value) {
       if ($type == 'birthdate') {
               $value = str_replace("<p>", "", $value);
               $value = str_replace("</p>", "", $value);
               $field = new BP_XProfile_Field($id);
               // Get children.
               $childs = $field->get_children();
               $show_age = false;
               if (isset($childs) && $childs && count($childs) > 0) {
                   // Get the name of custom post type.
                   if ($childs[0]->name == 'show_age')
                       $show_age = true;
               }
               if ($show_age) {
                   return '<p>'.floor((time() - strtotime($value))/31556926).'</p>';
               }
               return '<p>'.date_i18n( 'F j' , strtotime($value) ).'</p>';
           } elseif ($type == 'web') {
               if (strpos($value, 'href=') === false) {
                   $value = str_replace("<p>", "", $value);
                   $value = str_replace("</p>", "", $value);
                   return '<p><a href="'.$value.'" target="_blank">'.$value.'</a></p>';
               } else {
                   $value = str_replace('href=', 'target="_blank" href=', $value);
                   return $value;
               }
           } elseif ($type == 'select_custom_post_type') {
               $value = str_replace("<p>", "", $value);
               $value = str_replace("</p>", "", $value);
               // Get children.
               $field = new BP_XProfile_Field($id);
               $childs = $field->get_children();
               if (isset($childs) && count($childs) > 0) {
                   // Get the name of custom post type.
                   $custom_post_type = $childs[0]->name;
               }
               $post = get_post($value);
               if ($post->post_type == $custom_post_type) {
                   return '<p><a href="'.  get_permalink($post->ID).'">'.$post->post_title.'</a></p>';
               } else {
                   // Custom post type is not the same.
                   return '<p>--</p>';
               }
           }
   
           return $value_to_return;
       }
       ```
   
 * Do I need to change something in functions?
 * Thanks in advance!
 *  Plugin Author [donmik](https://wordpress.org/support/users/atallos/)
 * (@atallos)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/some-issues-5/#post-3681157)
 * Hi,
 * I don’t change anything about this, I think. Check in your edit.php (bp-themes/
   bp-default/members/single/profile/edit.php) where is the hook. If you are using
   buddypress 1.7:
 * `do_action( 'bp_custom_profile_edit_fields_pre_visibility' );`
 * Must be before visibility settings.
 * If you are using prior versions of buddypress, you will see this hook:
    `do_action('
   bp_custom_profile_edit_fields');` It must be after visibility settings. You can
   change where it shows, changing the position of this hook, writing before visibility
   settings.
 *  Thread Starter [Andres Felipe](https://wordpress.org/support/users/naturalworldstm/)
 * (@naturalworldstm)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/some-issues-5/#post-3681166)
 * Hi atallos and sorry for the loooooooooong delay
 * It still is in the wrong place as You can see in [this capture](https://dl.dropboxusercontent.com/u/60768679/captura.jpg)
 * Do You have any idea?
 * Thanks for your time!
 *  Plugin Author [donmik](https://wordpress.org/support/users/atallos/)
 * (@atallos)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/some-issues-5/#post-3681168)
 * Hi,
 * Sorry but I have no idea. Check your theme files and look for the hooks or see
   if the hook is placed above the code of visibility. You need to check your theme
   files with buddypress default theme because it works great with buddypress default
   theme.
 *  Thread Starter [Andres Felipe](https://wordpress.org/support/users/naturalworldstm/)
 * (@naturalworldstm)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/some-issues-5/#post-3681169)
 * You are right, I don’t know why but in 1.6.x doesn’t work but with 1.7.x works
   with the same theme.
 * Thanks for your support!

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

The topic ‘Some issues’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/buddypress-xprofile-custom-fields-
   type.svg)
 * [Buddypress Xprofile Custom Fields Type](https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-type/)
 * [Active Topics](https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-type/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-type/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/buddypress-xprofile-custom-fields-type/reviews/)

 * 11 replies
 * 2 participants
 * Last reply from: [Andres Felipe](https://wordpress.org/support/users/naturalworldstm/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/some-issues-5/#post-3681169)
 * Status: resolved