Make WordPress Core

Ticket #6297: 6297-renamed.diff

File 6297-renamed.diff, 928 bytes (added by devesine, 12 years ago)
  • wp-includes/formatting.php

     
    11691169 * @return string Balanced text
    11701170 */
    11711171function balanceTags( $text, $force = false ) {
    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                $balance_tags_delimiters = apply_filters( 'balance_tags_delimiters', array( '<!--more.*?-->', '<!--nextpage-->' ) );
     1174                // Capture lets PREG_SPLIT_DELIM_CAPTURE return the delimiters
     1175                $delimiters_regex = '/(' . implode( '|', $balance_tags_delimiters ) . ')/';
     1176                $parts = preg_split( $delimiters_regex, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
     1177                return implode( '', array_map( 'force_balance_tags', $parts ) );
     1178        }
     1179
     1180        return $text;
    11761181}
    11771182
    11781183/**