balancetags

函数
balancetags ( $text, $force = false )
参数
  • (string) $text Text to be balanced
    Required:
  • (bool) $force If true, forces balancing, ignoring the value of the option. Default false.
    Required:
    Default: false
返回值
  • (string) Balanced text
定义位置
相关方法
force_balance_tagsallowed_tagsmaintenance_nagget_tagsthe_tags
引入
0.71
弃用
-

balancetags: 这个函数用于平衡字符串中的HTML标签。它接收一个字符串作为参数,并返回带有平衡HTML标签的字符串。

如果被迫这样做,或者如果’use_balanceTags’选项被设置为”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;
	}
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-14 16:36:35

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: