balanceTags()

balanceTags()函数是Wordpress函数,如果强制,或者如果“使用平衡标记”选项设置为true,则平衡标记。

balanceTags( string $text, bool $force = false )

如果强制,或者如果“使用平衡标记”选项设置为true,则平衡标记。
Balances tags if forced to, or if the ‘use_balanceTags’ option is set to true.

参数(Parameters)

参数类型必填说明
$text(string)必需要平衡的文本
$force(bool)可选如果为true,则强制平衡,忽略选项的值。

返回(Return)

(string)平衡文本


源码(Source)

/**
 * Balances tags if forced to, or if the 'use_balanceTags' option is set to true.
 *
 * @since 0.71
 *
 * @param string $text  Text to be balanced
 * @param bool   $force If true, forces balancing, ignoring the value of the option. Default false.
 * @return string Balanced text
 */
function balanceTags( $text, $force = false ) {
	if ( $force || get_option('use_balanceTags') == 1 ) {
		return force_balance_tags( $text );
	} else {
		return $text;
	}
}
更新版本源码位置使用被使用
0.71wp-includes/formatting.php:243602

笔记(Notes)

未关闭的LI标记

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索