Jump to content

These Forums Are Now Read-Only

For TubePress support, please post a question here or open a support ticket and we will be glad to assist.


Vimeo Video description no newlines [SOLVED]

  • Please log in to reply
2 replies to this topic

#1 e. p.

e. p.


  • Members
  • PipPip
  • 14 posts

Posted 07 June 2012 - 04:24 AM

hi everybody

i know there's a issue with Youtube video descriptions, that are returned in simple text with all the html stripped out

is it the same for Vimeo? i would need at least the newlines in the description to be kept, any workaround?


#2 eric


    Lead Developer

  • TubePress Staff
  • 2787 posts

Posted 08 June 2012 - 12:41 AM


Here is the official bug report for the "fancy" descriptions (other than plain text). In the meantime, here's a workaround to keep the line breaks. This method will also be upgrade proof - i.e. your changes will persist when you upgrade TubePress.

  • Find your "tubepress-content/plugins" directory. In standalone PHP TubePress installations, this would be at "tubepress_x_y_z/content/plugins". In WordPress, this directory is located at "wp-content/tubepress-content/plugins".

  • Make a directory inside the "plugins" directory there called "newlinetobr". So in WordPress, for example, the full path of the directory would be "wp-content/tubepress-content/plugins/newlinetobr"

  • Save the following PHP to a file inside this directory. Call it "newlinetobr.php". So the full path will be "wp-content/tubepress-content/plugins/newlinetobr/newlinetobr.php"

    <?phpclass NewLine2Br{     function alter_video(org_tubepress_api_video_Video $video, $videoProviderName)     {        $description = $video->getDescription();        $description = nl2br($description);        $video->setDescription($description);        return $video;     }}TubePress::registerFilter('video', new NewLine2Br());
Voila! That should do the trick.

#3 e. p.

e. p.


  • Members
  • PipPip
  • 14 posts

Posted 08 June 2012 - 05:03 AM

And it does!

thank you Eric