diff --git src/bp-members/bp-members-template.php src/bp-members/bp-members-template.php
index e565b35..8d78ea2 100644
|
|
function bp_member_profile_data( $args = '' ) { |
900 | 900 | |
901 | 901 | // Declare local variables |
902 | 902 | $data = false; |
| 903 | $type = false; |
903 | 904 | |
904 | 905 | // Guess at default $user_id |
905 | 906 | $default_user_id = 0; |
… |
… |
function bp_member_profile_data( $args = '' ) { |
934 | 935 | |
935 | 936 | // Get the data for the specific field requested |
936 | 937 | if ( ! empty( $profile_data ) && ! empty( $profile_data[ $r['field'] ]['field_type'] ) && ! empty( $profile_data[ $r['field'] ]['field_data'] ) ) { |
937 | | $data = xprofile_format_profile_field( $profile_data[ $r['field'] ]['field_type'], $profile_data[ $r['field'] ]['field_data'] ); |
| 938 | $data = bp_unserialize_profile_field( $profile_data[ $r['field'] ]['field_data'] ); |
| 939 | $type = $profile_data[ $r['field'] ]['field_type']; |
938 | 940 | } |
939 | 941 | |
940 | | return apply_filters( 'bp_get_member_profile_data', $data ); |
| 942 | return apply_filters( 'bp_get_member_profile_data', $data, $type ); |
941 | 943 | } |
942 | 944 | |
943 | 945 | /** |
diff --git src/bp-xprofile/bp-xprofile-filters.php src/bp-xprofile/bp-xprofile-filters.php
index 50f10e0..f028921 100644
|
|
add_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_format_ |
30 | 30 | add_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_format_field_value_by_type', 8, 2 ); |
31 | 31 | add_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 ); |
32 | 32 | |
| 33 | add_filter( 'xprofile_get_random_profile_data_value', 'xprofile_filter_format_field_value', 1, 2 ); |
| 34 | add_filter( 'xprofile_get_random_profile_data_value', 'xprofile_filter_format_field_value_by_type', 8, 2 ); |
| 35 | |
| 36 | add_filter( 'bp_get_member_profile_data', 'xprofile_filter_format_field_value', 1, 2 ); |
| 37 | add_filter( 'bp_get_member_profile_data', 'xprofile_filter_format_field_value_by_type', 8, 2 ); |
| 38 | |
33 | 39 | add_filter( 'bp_get_the_profile_field_edit_value', 'force_balance_tags' ); |
34 | 40 | add_filter( 'bp_get_the_profile_field_edit_value', 'esc_html' ); |
35 | 41 | |
diff --git src/bp-xprofile/bp-xprofile-functions.php src/bp-xprofile/bp-xprofile-functions.php
index a437392..8bfb884 100644
|
|
function xprofile_get_field_id_from_name( $field_name ) { |
466 | 466 | * @global BuddyPress $bp The one true BuddyPress instance |
467 | 467 | * @global $wpdb WordPress DB access object. |
468 | 468 | * @global $current_user WordPress global variable containing current logged in user information |
469 | | * @uses xprofile_format_profile_field() Formats profile field data so it is suitable for display. |
| 469 | * @uses bp_unserialize_profile_field() |
470 | 470 | * @return string|bool The fetched random data for the user, or false if no data or no match. |
471 | 471 | */ |
472 | 472 | function xprofile_get_random_profile_data( $user_id, $exclude_fullname = true ) { |
… |
… |
function xprofile_get_random_profile_data( $user_id, $exclude_fullname = true ) |
475 | 475 | if ( empty( $field_data ) ) |
476 | 476 | return false; |
477 | 477 | |
478 | | $field_data[0]->value = xprofile_format_profile_field( $field_data[0]->type, $field_data[0]->value ); |
| 478 | $field_data[0]->value = apply_filters( 'xprofile_get_random_profile_data_value', bp_unserialize_profile_field( $field_data[0]->value ), $field_data[0]->type ); |
479 | 479 | |
480 | 480 | if ( empty( $field_data[0]->value ) ) |
481 | 481 | return false; |
… |
… |
function xprofile_get_random_profile_data( $user_id, $exclude_fullname = true ) |
484 | 484 | } |
485 | 485 | |
486 | 486 | /** |
487 | | * Formats a profile field according to its type. [ TODO: Should really be moved to filters ] |
| 487 | * Formats a profile field according to its type. |
| 488 | * |
| 489 | * @todo Mark as deprecated? Method is no longer used internally. |
488 | 490 | * |
489 | 491 | * @package BuddyPress Core |
490 | 492 | * @param string $field_type The type of field: datebox, selectbox, textbox etc |