Simple Facebook Connect
[resolved] Line breaks when crossposting to Facebook (3 posts)

  1. Piotr Bratzki
    Posted 4 years ago #

    (Hope i don't double post)


    I would like to crosspost Haiku Poems from WordPress to Facebook
    which require line breaks. Example:

    Bla blabla blabla
    Blabla blablabla blabla blabla
    blabla bla blabla

    Is there a way to transport the line break info from the blog to the facebook link, or to directly post it as a status including line break? (There is a way of posting line breaks in FB by using the Shift+Return keys, that's all i know..)

    I am not skilled in programming but can put in code pieces if someone tells me how and where - or can someone spot the point, why a blogpost's line break format is erased during transport?

    Any ideas are very welcome!


  2. Samuel Wood (Otto)
    WordPress.org Tech Dude
    Plugin Author

    Posted 4 years ago #

    Facebook doesn't allow line breaks in that description field. If you put them in, it strips them out.

    There is a really hacky way to do it using <center></center> instead to force a line break, but it's kind of a hack and so I don't recommend it.

    Still, sfc-base, line 444, you can change this:

    $text = str_replace(array("\r\n","\r","\n"),' ',$text);

    to this:

    $text = str_replace(array("\r\n","\r","\n"),'<center></center>',$text);

    If you want to try it. I do not recommend it. Unforeseen weird may occur.

  3. Piotr Bratzki
    Posted 4 years ago #

    Thank you, otto - after i messed it up by writing the code
    from the email note (which differs from the one here) it
    successfully posts the linebreaks, and erases all other formats.

    very very good - thank you !!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic