WordPress开发者和主题制作者的搜索引擎



balancetags ›

Since0.71
已弃用n/a
balancetags ( $text, $force = false )
参数: (2)
  • (string) $text Text to be balanced
    Required: Yes
  • (bool) $force If true, forces balancing, ignoring the value of the option. Default false.
    Required: No
    默认: false
返回:
  • (string) Balanced text
定义在:
文档:

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



源码

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