title: How To Get Wordpress User ID From External PHP Script?
body: <p>I'm trying to validate WooCommerce subscriptions and I need the userid to do it but it keeps returning 0 from $current_user->ID.</p>
  
  <pre><code>&lt;?php
  include('../wp-load.php');
  $current_user = wp_get_current_user();
  $SubCheck = WC_Subscriptions_Manager::user_has_subscription( $current_user-&gt;ID, 9, 'active' );
  ?&gt;
  </code></pre>