Ticket #4626 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

balanceTags() should not be option dependent

Reported by: mdawaffe Assigned to: anonymous
Priority: normal Milestone: 2.3
Component: Administration Version: 2.2.1
Severity: normal Keywords:
Cc:

Description

As a formatting function, balanceTags() should do just that - balance the tags. It's behavior should not depend on the use_balanceTags option. Whether the function is *called* should depend on the option.

Attached:

  1. makes balanceTags() option agnostic
  2. deprecates force_balance_tags()
  3. creates wp_balance_tags() which calls balanceTags() depending on the use_balanceTags option.

#2650 suggested the same and offered a patch that maintained backward compatibility. This patch is cleaner but breaks backward compatibility for some plugins. The older ticket was rejected, but I think the idea should be reconsidered (hence this ticket).

Attachments

4626.diff (2.9 kB) - added by mdawaffe on 07/12/07 23:57:39.
4626b.diff (1.1 kB) - added by mdawaffe on 07/13/07 01:29:26.
backward compatibility method

Change History

07/12/07 23:57:39 changed by mdawaffe

  • attachment 4626.diff added.

07/13/07 00:33:28 changed by mdawaffe

To be backward compatible, we could do essentially what #2650 suggested:

function balanceTags( $text, $force = false ) {
    if ( !$force && get_option('use_balanceTags') == 0 )
        return $text;
    return force_balance_tags( $text );
}

function force_balance_tags( $text ) {
    // old balanceTags code without option check
}

07/13/07 01:29:26 changed by mdawaffe

  • attachment 4626b.diff added.

backward compatibility method

07/16/07 19:23:41 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [5805]) Make balanceTags() option independent. Props mdawaffe. fixes #4626