wp_required_field_indicator

函数
wp_required_field_indicator ( No parameters )
返回值
  • (string) Indicator glyph wrapped in a `span` tag.
定义位置
相关方法
wp_required_field_messagewp_prepare_site_datawp_referer_fieldwp_redirect_admin_locationswp_resource_hints
引入
6.1.0
弃用
-

wp_required_field_indicator: 这个函数为WordPress管理面板中的表单字段添加一个必填字段指示器。它用于标记提交表单所需的字段。

为所需的表单字段分配一个视觉指示器。

function wp_required_field_indicator() {
	/* translators: Character to identify required form fields. */
	$glyph     = __( '*' );
	$indicator = '<span class="required">' . esc_html( $glyph ) . '</span>';

	/**
	 * Filters the markup for a visual indicator of required form fields.
	 *
	 * @since 6.1.0
	 *
	 * @param string $indicator Markup for the indicator element.
	 */
	return apply_filters( 'wp_required_field_indicator', $indicator );
}

常见问题

FAQs
查看更多 >
闪电侠

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

2025-12-14 09:36:28

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

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

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