| 1172 | | if ( $force || get_option('use_balanceTags') == 1 ) |
| 1173 | | return force_balance_tags( $text ); |
| 1174 | | else |
| 1175 | | return $text; |
| | 1172 | if ( $force || get_option('use_balanceTags') == 1 ) { |
| | 1173 | $quicktags = apply_filters( 'balancetags_quicktags', array( 'more.*?', 'nextpage' ) ); |
| | 1174 | // Outer capture lets PREG_SPLIT_DELIM_CAPTURE return the quicktags |
| | 1175 | // Inner noncapturing group matches any of the defined quicktags |
| | 1176 | $quicktag_regex = '/(<!--(?:' . implode( '|', $quicktags ) . ')-->)/'; |
| | 1177 | $parts = preg_split( $quicktag_regex, $text, -1, PREG_SPLIT_DELIM_CAPTURE ); |
| | 1178 | return implode( '', array_map( 'force_balance_tags', $parts ) ); |
| | 1179 | } |
| | 1180 | |
| | 1181 | return $text; |