title: Can't get post_ID inside wordpress plugin
body: <p>I'm trying to make my first WP plugin, but stuck on simple function - can't get ID of post inside it.</p>
  <p>I have tried:</p>
  <pre class="lang-php prettyprint-override"><code>$post_id = get_the_ID();
  </code></pre>
  <p>After that I thought, that my plugin works outside loop and try this:</p>
  <pre class="lang-php prettyprint-override"><code>global $post;
  $post_id = $post-&gt;ID;
  </code></pre>
  <p>Few hours later I have tried to create function, that get post id after INIT:</p>
  <pre class="lang-php prettyprint-override"><code>function postidfinder () {
      global $post;
      $post_id = $post-&gt;ID;
      return $post_id
  }
  add_action( 'init', 'postfinder' );
  </code></pre>
  <p>Also tried actions: wp_loaded, loop_query.</p>
  <p>Please, help get post ID to the plugin. Thanks!</p>