wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



balancetags › WordPress Function

Od0.71
Przestarzałyn/a
balancetags ( $text, $force = false )
Parametry: (2)
  • (string) $text Text to be balanced
    Wymagane: Tak
  • (bool) $force If true, forces balancing, ignoring the value of the option. Default false.
    Wymagane: Nie
    Domyślny: false
Powrót:
  • (string) Balanced text
Zdefiniowane na:
Codex:

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



Źródło

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