WordPress.org

Ready to get started?Download WordPress

Forums

Network Latest Posts
nl2br issue (2 posts)

  1. mcmikemn
    Member
    Posted 1 year ago #

    I use and like this plugin - thanks for it!

    I do have a request, though. I noticed when a post had an un-ordered list that it would display "fine" in the actual post, but would have many more line breaks in the NLP display. Viewing the source, the NLP display adds BR tags around every
    LI tag.

    I'm not a coder, but browsing through the plugin's "network-latest-posts.php" file, I found four calls to nl2br(). Based on the if() statements, I changed only the one pertinent to my scenario and voila: the extraneous BR tags were gone. Yay!

    FYI, I changed line 972 from:
    echo nl2br( do_shortcode( $field->post_content ) );
    to:
    echo ( do_shortcode( $field->post_content ) );

    But my problem is that when I update the plugin to your next release, my change to your code will disappear. Can you make this a user-interface option, so it is saved between plugin updates?

    Thanks again.

  2. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 1 year ago #

    Hello, thanks for your feedback. I will keep your suggestion in mind, certainly I can't remove it because for some people line breaks don't appear without nl2br. So I will give people the option to use it or not.

    Cheers.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic