title: How to get post_id from order_id in woocommerce
body: <p>I need to get post_id in wordpress from woocommerce order id or order number. </p>
  
  <pre><code>global $woocommerce, $post;
  
  $order = new WC_Order($post-&gt;ID);
  
  //to escape # from order id 
  
  $order_id = trim(str_replace('#', '', $order-&gt;get_order_number()));
  </code></pre>
  
  <p>with this code i am getting order id from post id. I have to reverse this and get post id from order id. </p>