woocommerce_form_field and hidden fields

前端 未结 5 675
[愿得一人]
[愿得一人] 2021-01-14 17:18

I\'m trying to add custom fields to the WooCommerce checkout and there seems to be no output for hidden fields.

In woocommerce-template.php, hidden fie

5条回答
  •  北海茫月
    2021-01-14 17:54

    Actually. The last paramatert of the add_filter function is the number of parameters to the function.

    The third one is the priority.

    add_filter('woocommerce_form_field_hidden', 'wcds_form_field_hidden', 999, 4);
    
    function wcds_form_field_hidden($no_parameter, $key, $args, $value) {
    
        $field = '

    '; return $field; }

    This worked for me.

提交回复
热议问题