Hi Donmik,
As my question is somewhat relevant to this thread I’ll post it here.
I would like to remove the <p>…</p> that gets added to the birthdate field (and preferably all fields). I know there is this code below:
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>';
}
return $value_to_return;
}
But I’m not sure how to edit that just to remove the <p></p> and keep the rest the same.
Thanks,
Alex