Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Christian Wach

    (@needle)

    Hi Andrew, could you explain how you want to “get the html output” in a bit more detail? Do you mean programatically on save?

    Cheers, Christian

    Thread Starter aburget

    (@aburget)

    Hi,

    look here: https://www.dot-ev.de/apparat_abstrakt/

    In the Backend the user write down his info. Paragraphs shown in the editor. In the frontend there are no <p> inside/shown.

    regards
    andrew

    Plugin Author Christian Wach

    (@needle)

    Ok, I see. What code are you using to pull the profile data into the theme?

    Cheers, Christian

    Thread Starter aburget

    (@aburget)

    See below:

    <?php if ( $Kurzinfo = bp_get_profile_field_data( ‘field=Kurzinfo’ ) ) : ?>
    <?php echo bp_member_profile_data( ‘field=Kurzinfo’);?>
    <?php endif ?>

    thx
    andrew

    Plugin Author Christian Wach

    (@needle)

    Hmm, yes it does seem like a filtering oversight in this plugin. I’ll look into it further. In the meantime, you could use bp_profile_field_data( array( 'field' => 'Kurzinfo', 'user_id' => 'your-user-id' ) ) instead.

    Cheers, Christian

    Plugin Author Christian Wach

    (@needle)

    Oh, hang on, it’s simpler than that. You already get $Kurzinfo to test if it has a value. Why not just echo it? It should be properly formatted already.

    Cheers, Christian

    Thread Starter aburget

    (@aburget)

    what was copy paste, i needed if else several times, e.g. no images than show current conventions …

    i remove it, now only echo, but still the same?…

    Plugin Author Christian Wach

    (@needle)

    Not entirely clear what you mean. I meant code that looks something like:

    $Kurzinfo = bp_get_profile_field_data( 'field=Kurzinfo' );
    if ( ! empty( $Kurzinfo ) ) echo $Kurzinfo;

    Though this assumes that bp_displayed_user_id() is correctly populated.

    Thread Starter aburget

    (@aburget)

    HI!
    Fine. This works. You are my friend.
    -> https://www.dot-ev.de/apparat_abstrakt/

    Plugin Author Christian Wach

    (@needle)

    Glad to hear that it’s fixed and thank you for raising the issue. I need to document this in the plugin because BuddyPress does not offer a way to properly filter the xProfile content fetched by bp_get_member_profile_data(). It was discussed here but the type filter was never implemented.

    Cheers, Christian

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Formatting Paragraph’ is closed to new replies.