title: how to get wp include directory?
body: <p>I need to do require_once for my wp plugin development. It seems to me that I need to use absolute path.</p>
  
  <p>my current solution is</p>
  
  <pre><code>$delimiter = strpos(dirname(__FILE__), "/")!==false?"/":"\\"; //win or unix?
  $path = explode($delimiter,  dirname(__FILE__));
  
  require_once join(array_slice($path,0,count($path)-3),$delimiter) . "/wp-admin/includes/plugin.php"; 
  </code></pre>
  
  <p><strong>I wonder if there is a better way to handle this, kind of general approach.</strong> </p>
  
  <p>What if the wp plugin directory structure changes. So this part <code>count($path)-3</code> won't be valid any more ....</p>