[buddypress-trac] [BuddyPress Trac] #8047: Some profile fields create empty links

buddypress-trac noreply at wordpress.org
Thu Jan 31 18:56:56 UTC 2019

#8047: Some profile fields create empty links
 Reporter:  shanebp           |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Extended Profile  |    Version:  4.1.0
 Severity:  normal            |   Keywords:
 The ''phone number'' and ''url'' fields create empty links if there is no
 data for that user.
 [ Other fields may also do that. ]

 For example, create a ''Phone Number'' profile field and set ''autolink''
 to disabled.
 Leave the field empty for all users.
 Then add this to bp-custom, after adjusting the args for
 function xprofile_link_test() {

         $field_value = xprofile_get_field_data( 3, 1, $multi_format =
 'comma' );

         var_dump( $field_value ); // string(36) ""

         echo '<br>';

         echo 'field value: ' . $field_value;

         // the fields looks empty, but is really:
         // <a href="tel://" rel="nofollow"></a>

 add_action ( 'wp_head', 'xprofile_link_test' );

 As you can see, it is impossible to test for an empty field value.
 And that can cause layout and formatting issues.


 1. Why are empty links being created ?

 2. Why is the ''autolink'' setting being ignored for some fields?  If
 there is field data for a member, that field is displayed as a link
 regardless of the state of the ''autolink'' setting.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8047>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac

More information about the buddypress-trac mailing list