这是电子邮件字段的代码 woocommerce插件 - > form-login.php 文件
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
<label for="reg_email"><?php _e( 'Email address', 'woocommerce' ); ?> <span class="required">*</span></label>
<input type="text" name="email" id="reg_email" value="<?php echo ( ! empty( $_POST['email'] ) ) ? esc_attr( $_POST['email'] ) : ''; ?>" />
</p>
我找到了代码,但我不知道该把它放在哪里
<?php if (preg_match('|@onlyalloweddomain.com$|', $registrantMailAddress; ?>
提前致谢并感谢您的帮助
答案 0 :(得分:0)
我刚刚制作了这个并且它完美无缺,正确的解决方案
<p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide">
<label for="reg_email"><?php _e( 'Email address', 'woocommerce' ); ?> <span class="required">*</span></label>
<input type="email" class="woocommerce-Input woocommerce-Input--text input-text" name="email" id="reg_email" pattern="[a-z0-9._%+-]+@[g-u]+\.[d-u]+\.[j-o]{2}$" value="<?php echo ( ! empty( $_POST['email'] ) ) ? esc_attr( $_POST['email'] ) : ''; ?>" />
</p>