balanceTags() WP 1.0
Balances tags if forced to, or if the 'use_balanceTags' option is set to true.
Works based on: force_balance_tags()
No Hooks.
Return
String. Balanced text
Usage
balanceTags( $text, $force ) // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid;
- $text(string) (required)
- Text to be balanced
- $force(true/false)
- If true, forces balancing, ignoring the value of the option.
Default: false
Changelog
Since 0.71 | Introduced. |
Code of balanceTags() balanceTags WP 5.6
function balanceTags( $text, $force = false ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
if ( $force || (int) get_option( 'use_balanceTags' ) === 1 ) {
return force_balance_tags( $text );
} else {
return $text;
}
}Related Functions
From tag: Site security (safety)
More from category: Formatting
- absint()
- add_magic_quotes()
- antispambot()
- backslashit()
- capital_P_dangit()
- convert_smilies()
- ent2ncr()
- links_add_target()
- make_clickable()