WordPress at a glance

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.


String. Balanced text


balanceTags( $text, $force );
$text(string) (required)
Text to be balanced
If true, forces balancing, ignoring the value of the option.
Default: false


Since 0.71 Introduced.

Code of balanceTags: wp-includes/formatting.php WP 5.2.4

function balanceTags( $text, $force = false ) {
	if ( $force || get_option( 'use_balanceTags' ) == 1 ) {
		return force_balance_tags( $text );
	} else {
		return $text;

Related Functions

From tag: Site security (safety)

More from category: Formatting

No comments
    Hello, !     Log In . Register