add nl2br support
This commit is contained in:
parent
e45a2b0e2e
commit
12ad221d29
|
@ -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, '<div class="transcript">' . do_shortcode($transcript) . '</div>');
|
||||
$content = do_shortcode($transcript);
|
||||
$options = get_option('what-did-they-say-options');
|
||||
if ($options['use_nl2br']) { $content = nl2br($content); }
|
||||
return array($transcript, '<div class="transcript">' . $content . '</div>');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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);
|
||||
|
|
|
@ -13,15 +13,27 @@
|
|||
</label>
|
||||
|
||||
<label>
|
||||
<?php _e('Include default CSS styles for transcripts:', 'what-did-they-say') ?>
|
||||
<input type="checkbox"
|
||||
name="wdts[default_styles]"
|
||||
value="yes"
|
||||
<?php echo ($options['load_default_styles'] ? 'checked="checked"' : '') ?> />
|
||||
<?php _e('Include default CSS styles for transcripts', 'what-did-they-say') ?>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
<input type="checkbox"
|
||||
name="wdts[use_nl2br]"
|
||||
value="yes"
|
||||
<?php echo ($options['use_nl2br'] ? 'checked="checked"' : '') ?> />
|
||||
<?php _e('Turn transcript line breaks into HTML new lines (nl2br())', 'what-did-they-say') ?>
|
||||
</label>
|
||||
<input class="button" type="submit" value="<?php _e('Change default styles', 'what-did-they-say') ?>" />
|
||||
</form>
|
||||
|
||||
<h3><?php _e('Transcript Line Breaks', 'what-did-they-say') ?></h3>
|
||||
|
||||
<p><?php _e('If you\'re using short codes or HTML to construct your transcripts, you don\'t need to enable transcript line breaks.', 'what-did-they-say') ?></p>
|
||||
|
||||
<h3><?php _e('Default CSS Selectors Information', 'what-did-they-say') ?></h3>
|
||||
|
||||
<p><?php _e('By default, the following CSS selectors are used by <strong>What Did They Say?!?</strong>:', 'what-did-they-say') ?></p>
|
||||
|
|
Loading…
Reference in New Issue