Opened 19 years ago
Closed 19 years ago
#4626 closed defect (bug) (fixed)
balanceTags() should not be option dependent
| Reported by: | mdawaffe | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.3 |
| Component: | Administration | Version: | 2.2.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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:
- makes
balanceTags()option agnostic - deprecates
force_balance_tags() - creates
wp_balance_tags()which callsbalanceTags()depending on theuse_balanceTagsoption.
#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 (2)
Change History (4)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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 }