balanceTags()
balanceTags( string $text, bool $force = false ) 如果强制,或…
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.71 | wp-includes/formatting.php:2436 | 0 | 2 | 
笔记(Notes)
未关闭的LI标记
类别:WordPress 函数手册、 
		本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。







还没有任何评论,赶紧来占个楼吧!