WordPress.org

Make WordPress Core

Ticket #22537: 22537-balanceTags.patch

File 22537-balanceTags.patch, 886 bytes (added by TobiasBg, 8 years ago)

Fix balanceTags() docs and make the function better readable

  • wp-includes/formatting.php

     
    11321132}
    11331133
    11341134/**
    1135  * Will only balance the tags if forced to and the option is set to balance tags.
     1135 * Balances tags if forced to, or if the 'use_balanceTags' option is set to true.
    11361136 *
    1137  * The option 'use_balanceTags' is used to determine whether the tags will be balanced.
    1138  *
    11391137 * @since 0.71
    11401138 *
    11411139 * @param string $text Text to be balanced
     
    11431141 * @return string Balanced text
    11441142 */
    11451143function balanceTags( $text, $force = false ) {
    1146         if ( !$force && get_option('use_balanceTags') == 0 )
     1144        if ( $force || get_option('use_balanceTags') == 1 )
     1145                return force_balance_tags( $text );
     1146        else
    11471147                return $text;
    1148         return force_balance_tags( $text );
    11491148}
    11501149
    11511150/**