Profile Field Mapping

I’ve given up on the other issues I’m having with the plugin… so I’m using 2.0.1 (just for the record).

When I import the profile field “Bio” into the “description” field for wordpress, it places line breaks where they are supposed to be… except that it does not put in actual code for those breaks (no
or </p> tags). So when outputting the information that is saved in the database, everything looks jumbled together.

I’ve added the following to my functions.php in order to support the html tags, but need to know how to have the filter disabled prior to the import of data (so that the tags are saved into the database when the import is done, instead of only when the user manually edits their description).

remove_filter('pre_user_description', 'wp_filter_kses');
add_filter('pre_user_description', 'wp_filter_post_kses');
add_filter('pre_user_description', 'wptexturize');
add_filter('pre_user_description', 'wpautop');
add_filter('pre_user_description', 'convert_chars');
add_filter('pre_user_description', 'balanceTags', 50);

  • CanadianCreative
    • WPMU DEV Initiate

    That would work if the Facebook import would place tags to show where the new lines are, instead of just open spaces.

    It imports the data like this:

    this is line one from the Bio.

    This is line 2 from the Bio.

    This is line 3.

    What nl2br would need is for it to import the data as:

    This is line one from the Bio.rn
    This is line 2 from the Bio.rn
    This is line 3.rn

    This is how Facebook actually displays the data:

    <div class="fbTimelineSection mtm fbTimelineCompactSection"><div class="uiHeader fbTimelineAboutMeHeader"><div class="clearfix uiHeaderTop"><div><h3 tabindex="0" class="uiHeaderTitle">About Username</h3></div></div></div><div class="profileText">this is line one from the Bio.<br> <br>This is line 2 from the Bio.<br> <br>This is line 3.</div></div>

    And this is how it displays in the users Profile Editor Dashboard:

    this is line one from the Bio.

    This is line 2 from the Bio.

    This is line 3.

    And this is how WordPress interprets the Imported data:

    this is line one from the Bio.This is line 2 from the Bio.This is line 3.

    So I think either the plugin needs to not strip the br tags from the data when it imports the Bio section, or it needs to be run through some sort of filter that can put them back.

  • Vladislav
    • Dead Eye Dev


    Actually, the plugin doesn’t do anything to pre-process the data imported from Facebook, including stripping any tags – raw Facebook profile data does not include the BR tags – they are most likely added by Facebook when displaying the data using pretty much the same solution. Since the data isn’t pre-processed, the whitespaces (including linebreaks) aren’t normalized either, which means that nl2br has everything it needs to convert your linebreaks to BR tags (it doesn’t need the literal “rn” character sequence to process linebreaks).

    I just tried importing a multi-line field and passing it through nl2br, which yielded the expected results – the newlines were properly converted to

  • aecnu
    • WP Unicorn

    Greetings CanadianCreative,

    We have not heard back from you as to the status of this issue.

    If you are still having an issue please let us know so that we may try to get you fixed up as soon as possible by choosing to check mark this ticket as unresolved below and posting any new errors or symptoms you are noticing.

    This action will also bring your ticket up front back in plain view again within the ticket system.

    Thank you for being a WPMU Dev member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.