mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Make balanceTags() option independent. Props mdawaffe. fixes #4626
git-svn-id: http://svn.automattic.com/wordpress/trunk@5805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
714f8edd6c
commit
db54c8c57d
@ -413,8 +413,14 @@ function funky_javascript_fix($text) {
|
|||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function balanceTags( $text, $force = false ) {
|
||||||
|
if ( !$force && get_option('use_balanceTags') == 0 )
|
||||||
|
return $text;
|
||||||
|
return force_balance_tags( $text );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
balanceTags
|
force_balance_tags
|
||||||
|
|
||||||
Balances Tags of string using a modified stack.
|
Balances Tags of string using a modified stack.
|
||||||
|
|
||||||
@ -433,11 +439,7 @@ function funky_javascript_fix($text) {
|
|||||||
Added Cleaning Hooks
|
Added Cleaning Hooks
|
||||||
1.0 First Version
|
1.0 First Version
|
||||||
*/
|
*/
|
||||||
function balanceTags($text, $force = false) {
|
function force_balance_tags( $text ) {
|
||||||
|
|
||||||
if ( !$force && get_option('use_balanceTags') == 0 )
|
|
||||||
return $text;
|
|
||||||
|
|
||||||
$tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = '';
|
$tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = '';
|
||||||
$single_tags = array('br', 'hr', 'img', 'input'); //Known single-entity/self-closing tags
|
$single_tags = array('br', 'hr', 'img', 'input'); //Known single-entity/self-closing tags
|
||||||
$nestable_tags = array('blockquote', 'div', 'span'); //Tags that can be immediately nested within themselves
|
$nestable_tags = array('blockquote', 'div', 'span'); //Tags that can be immediately nested within themselves
|
||||||
@ -536,10 +538,6 @@ function balanceTags($text, $force = false) {
|
|||||||
return $newtext;
|
return $newtext;
|
||||||
}
|
}
|
||||||
|
|
||||||
function force_balance_tags($text) {
|
|
||||||
return balanceTags($text, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function format_to_edit($content, $richedit = false) {
|
function format_to_edit($content, $richedit = false) {
|
||||||
$content = apply_filters('format_to_edit', $content);
|
$content = apply_filters('format_to_edit', $content);
|
||||||
if (! $richedit )
|
if (! $richedit )
|
||||||
|
Loading…
Reference in New Issue
Block a user