title: How does woocommerce_loop_add_to_cart_link filter hook work in depth?
body: <p>I have some basic Woocommerce questions and cannot find anywhere online.</p>
  
  <ul>
  <li>from the code below, where are $args come from? </li>
  <li>how $product and $args assign to %s ?</li>
  </ul>
  
  <p>thanks!</p>
  
  <pre class="lang-php prettyprint-override"><code>global $product;
  
  echo apply_filters( 'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok.
      sprintf( '&lt;a href="%s" data-quantity="%s" class="%s" %s&gt;%s&lt;/a&gt;',
          esc_url( $product-&gt;add_to_cart_url() ),
          esc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ),
          esc_attr( isset( $args['class'] ) ? $args['class'] : 'button' ),
          isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '',
          esc_html( $product-&gt;add_to_cart_text() )
      ),
  $product, $args );
  </code></pre>