Title: Age not clickable??
Last modified: August 21, 2016

---

# Age not clickable??

 *  Resolved [madcap66](https://wordpress.org/support/users/madcap66/)
 * (@madcap66)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/age-not-clickable/)
 * Love this plugin – just one question. All the fields I’ve created are clickable
   and display all those members with the same attribute, but Age isn’t clickable…
 * Is this normal or is there somewhere I can enable Age as a clickable field?
 * Thanks.
 * [http://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/](http://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/)

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

 *  Plugin Author [donmik](https://wordpress.org/support/users/atallos/)
 * (@atallos)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/age-not-clickable/#post-4200876)
 * It’s because I removed the filter that is adding the links in my plugin. It was
   causing errors with my plugin. If you want it back you can filter the values 
   returned by my plugin. This is a sample code:
 *     ```
       function my_show_field_value($value_to_return, $type, $id, $value) {
           $field = new BP_XProfile_Field($id);
           if ($type == 'birthdate') {
               // Get children.
               $childs = $field->get_children();
               $show_age = false;
               if (isset($childs) && $childs && count($childs) > 0 && is_object($childs[0])) {
                   if ($childs[0]->name == 'show_age')
                       $show_age = true;
               }
               if ($value != '') {
                   if ($show_age) {
                       $new_value = floor((time() - strtotime($value))/31556926);
                   } else {
                       $new_value = date_i18n(get_option('date_format') ,strtotime($value) );
                   }
                   $new_value = xprofile_filter_link_profile_data($new_value, $type);
                   $value_to_return = '<p>'.$new_value.'</p>';
               }
           }
   
           return $value_to_return;
       }
       add_filter('bxcft_show_field_value', 'my_show_field_value', 10, 4);
       ```
   
 * If you add this filter in your functions.php of your theme. The age will be a
   clickable field too.
 *  Thread Starter [madcap66](https://wordpress.org/support/users/madcap66/)
 * (@madcap66)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/age-not-clickable/#post-4200885)
 * Added your code and Age is now clickable but when clicked it always returns no
   members found even though there are members of the same age. Any idea why this
   might be happening? Or was that the reason it was removed?
 * Thanks.
 *  Plugin Author [donmik](https://wordpress.org/support/users/atallos/)
 * (@atallos)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/age-not-clickable/#post-4200923)
 * Ok, it’s because buddypress is looking for the age inside the database, but in
   database my plugin have recorded the birthdate in mysql format and not the age.
 * So, I think there is no easy solution to solve this, if you need to search inside
   your members I recommend you use [BP Profile Search plugin](http://wordpress.org/plugins/bp-profile-search/).
 *  Thread Starter [madcap66](https://wordpress.org/support/users/madcap66/)
 * (@madcap66)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/age-not-clickable/#post-4200994)
 * [@donmik](https://wordpress.org/support/users/donmik/) – I’m already using the
   BP Profile Search plugin, and the age search works perfectly. Just a bummer that
   the one profile field of Age isn’t directly searchable…
 * Would love to have this feature…Thx

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

The topic ‘Age not clickable??’ 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/)

 * 4 replies
 * 2 participants
 * Last reply from: [madcap66](https://wordpress.org/support/users/madcap66/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/age-not-clickable/#post-4200994)
 * Status: resolved