Php 清除WooCommerce中特定用户的签出字段
此代码为每个人清除签出页面的所有输入。我想清除特定用户的所有输入。我怎样才能做到这一点Php 清除WooCommerce中特定用户的签出字段,php,wordpress,woocommerce,hook-woocommerce,userid,Php,Wordpress,Woocommerce,Hook Woocommerce,Userid,此代码为每个人清除签出页面的所有输入。我想清除特定用户的所有输入。我怎样才能做到这一点 add_filter( 'woocommerce_checkout_get_value' , 'clear_checkout_fields' ); function clear_checkout_fields($input) { return ''; } 对于可使用的已定义用户ID(在IF语句中设置相关用户ID): 或对于用户ID数组: add_filter( 'wooco
add_filter( 'woocommerce_checkout_get_value' , 'clear_checkout_fields' );
function clear_checkout_fields($input)
{
return '';
}
对于可使用的已定义用户ID(在IF语句中设置相关用户ID): 或对于用户ID数组:
add_filter( 'woocommerce_checkout_get_value', 'clear_checkout_fields' );
function clear_checkout_fields( $input ) {
if ( in_array( get_current_user_id(), array( 259, 321, 336 ) ) {
return '';
}
return $input;
}
thx它正在工作。
add_filter( 'woocommerce_checkout_get_value', 'clear_checkout_fields' );
function clear_checkout_fields( $input ) {
if ( in_array( get_current_user_id(), array( 259, 321, 336 ) ) {
return '';
}
return $input;
}