From 12ad221d2906ac7f9b3c0ca4a0b127b3e497bc1a Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 30 Sep 2009 21:50:16 -0400 Subject: [PATCH] add nl2br support --- classes/WhatDidTheySayAdmin.inc | 9 +++++++-- classes/partials/_default-styles.inc | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/classes/WhatDidTheySayAdmin.inc b/classes/WhatDidTheySayAdmin.inc index e751720..e3348dc 100644 --- a/classes/WhatDidTheySayAdmin.inc +++ b/classes/WhatDidTheySayAdmin.inc @@ -20,7 +20,8 @@ class WhatDidTheySayAdmin { 'load_default_styles' => true, 'automatic_embedding' => true, 'search_integration' => true, - 'excerpt_distance' => 30 + 'excerpt_distance' => 30, + 'use_nl2br' => false ); var $capabilities = array(); @@ -228,7 +229,10 @@ class WhatDidTheySayAdmin { * @return string The processed transcription text. */ function the_media_transcript($transcript, $content = "") { - return array($transcript, '
' . do_shortcode($transcript) . '
'); + $content = do_shortcode($transcript); + $options = get_option('what-did-they-say-options'); + if ($options['use_nl2br']) { $content = nl2br($content); } + return array($transcript, '
' . $content . '
'); } /** @@ -499,6 +503,7 @@ class WhatDidTheySayAdmin { $options = get_option('what-did-they-say-options'); $options['load_default_styles'] = isset($info['default_styles']); + $options['use_nl2br'] = isset($info['use_nl2br']); $options['excerpt_distance'] = !empty($info['excerpt_distance']) ? $info['excerpt_distance'] : 30; update_option('what-did-they-say-options', $options); diff --git a/classes/partials/_default-styles.inc b/classes/partials/_default-styles.inc index 40925c9..f7c97a5 100644 --- a/classes/partials/_default-styles.inc +++ b/classes/partials/_default-styles.inc @@ -13,15 +13,27 @@ + + +

+ +

+

What Did They Say?!?:', 'what-did-they-say') ?>