Php 如何检查电子邮件存在Wordpress
我在woocommerce的签出页面中创建自定义字段以添加试剂用户电子邮件:Php 如何检查电子邮件存在Wordpress,php,wordpress,woocommerce,Php,Wordpress,Woocommerce,我在woocommerce的签出页面中创建自定义字段以添加试剂用户电子邮件: add_action( 'woocommerce_after_order_notes', 'my_custom_checkout_field' ); function my_custom_checkout_field( $checkout ) { woocommerce_form_field( 'my_field_name', array( 'type' => 't
add_action( 'woocommerce_after_order_notes', 'my_custom_checkout_field' );
function my_custom_checkout_field( $checkout ) {
woocommerce_form_field( 'my_field_name', array(
'type' => 'text',
'class' => array('my-field-class form-row-wide'),
'label' => __('ایمیل معرف'),
'placeholder' => __('ایمیل معرف خود را وارد کنید'),
), $checkout->get_value( 'my_field_name' ));
echo '</div>';
return $checkout;
}
但是代码不起作用并且没有得到任何错误。。。
那么如何做到这一点呢?什么是“reagant用户电子邮件”?另外,my\u custom\u checkout\u字段
filter不存在,因此您不过滤任何内容。这里有一个关于什么是“reagant用户电子邮件”的教程?另外,my\u custom\u checkout\u字段
filter不存在,因此您不过滤任何内容。这里有一个关于
add_filter('my_custom_checkout_field', 'yourprefix_process_myaccount_address_fields' );
function yourprefix_process_myaccount_address_fields( $checkout ) {
$exists = email_exists($checkout);
if ( $exists )
echo "That E-mail is registered to user number" . $exists;
else
wc_add_notice( __( 'Email not exist', 'woocommerce' ), 'error' );
}
}