title: get_terms gives "invalid taxonomy" from plugin
body: <p>I'm building a plugin for woocommerce and i have some troubles. I'm trying to get all avalible product categories. </p>
  
  <p>the code simply looks like this:</p>
  
  <pre><code>$cats = get_terms('product_cat', array('hide_empty' =&gt; 0, 'orderby' =&gt; 'ASC',  'parent' =&gt;0));
  print_r($cats);
  </code></pre>
  
  <p>This gives me </p>
  
  <pre><code>WP_Error Object
  (
      [errors:WP_Error:private] =&gt; Array
          (
              [invalid_taxonomy] =&gt; Array
                  (
                      [0] =&gt; Invalid taxonomy
                  )
          )
      [error_data:WP_Error:private] =&gt; Array
      (
      )
  )
  </code></pre>
  
  <p>Do i need to hook this to some special init or something? I tried the same code in functions.php but with the same error.</p>
  
  <p>EDIT:
  Yep, i found a soluiton to the problem. I added </p>
  
  <pre><code>add_action('init', 'runMyPlugin');
  </code></pre>
  
  <p>did the trick!</p>