wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



balancetags › WordPress Function

Depuis0.71
Dépréciéen/a
balancetags ( $text, $force = false )
Paramètres: (2)
  • (string) $text Text to be balanced
    Requis: Oui
  • (bool) $force If true, forces balancing, ignoring the value of the option. Default false.
    Requis: Non
    Défaut: false
Retourne:
  • (string) Balanced text
Défini(e) dans:
Codex:

Balances tags if forced to, or if the 'use_balanceTags' option is set to true.



Source

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;
	}
}