Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: calling specific profile fields individually


h4x3d
Participant

@h4x3d

or maybe something with unserialize&stripslashes?

I found this in reference to the code mentioned above:

* xprofile_format_profile_field()<br />
955 *<br />
956 * Formats a profile field according to its type. [ TODO: Should really be moved to filters ]<br />
957 *<br />
958 * @package BuddyPress Core<br />
959 * @param $field_type The type of field: datebox, selectbox, textbox etc<br />
960 * @param $field_value The actual value<br />
961 * @uses bp_format_time() Formats a time value based on the WordPress date format setting<br />
962 * @return $field_value The formatted value<br />
963 */<br />
964 function xprofile_format_profile_field( $field_type, $field_value ) {<br />
965 if ( !isset($field_value) || empty( $field_value ) )<br />
966 return false;<br />
967<br />
968 $field_value = bp_unserialize_profile_field( $field_value );<br />
969<br />
970 if ( 'datebox' == $field_type ) {<br />
971 $field_value = bp_format_time( $field_value, true );<br />
972 } else {<br />
973 $content = $field_value;<br />
974 $content = apply_filters('the_content', $content);<br />
975 $field_value = str_replace(']]>', ']]>', $content);<br />
976 }<br />
977<br />
978 return stripslashes( stripslashes( $field_value ) );<br />
979 }

and this

function bp_unserialize_profile_field( $value ) {

522 if ( is_serialized($value) ) {

523 $field_value = maybe_unserialize($value);

524 $field_value = implode( ', ', $field_value );

525 return $field_value;

526 }

527

528 return $value;

529 }

Skip to toolbar