• Hi guys,

    I tried to add a filter to woocommerce_admin_billing_fields hook but it just doesn’t fire. Following is the add_filter call that I used:
    add_filter( 'woocommerce_admin_billing_fields', 'custom_function', 9, 1 );

    I know that this call is reachable because I have other hooks defined here all of which are working. The filter function that I am using is

    
    function custom_function($fields) {
      $file = fopen('/var/www/html/debug.txt', 'a');
      fwrite($file, json_encode($fields) . "\n\n");
      fclose($file);
      return $fields;
    }
    

    I am a beginner to wordpress plugin development and I do not understand why this filter won’t work. What could be wrong with this?

    Thanks to anybody who helps.

    Ashish

  • The topic ‘woocommerce_admin_billing_fields not working’ is closed to new replies.