title: Accessing WC_Product protected data in Woocommerce 3
body: <p>I have this answer for reference: <a href="https://stackoverflow.com/questions/35165402/woocommerce-get-product-values-by-id/35165541#35165541">Woocommerce Get Product Values by ID</a> … It is about the function <code>wc_get_product()</code> that returns protected data.</p>
  
  <p>Where are the getter methods defined for that function? <br>
  How can i access the protected data inside <code>wc_get_product()</code>?</p>
  
  <p><a href="https://docs.woocommerce.com/wc-apidocs/function-wc_get_product.html" rel="nofollow noreferrer">This Answer thread</a> is telling that <code>WC_Product_Factory</code> class is being used.  Can this class be extended to access the protected data inside <code>wc_get_product()</code>?</p>
  
  <p>The <code>wc_get_product()</code> seems to be a function, but how does it return an object?</p>