title: Wordpress Custom Post Type Submenu Can't Access Constants or $this
body: <p>Ok, I've got a custom post type in a plugin, and the plugin is structured as a class. I'm also setting some constants for the plugin as well.</p>
  
  <p>I've created a submenu for the custom post type, but my problem is that when I access that page, it can't access the plugin constants or the class' $this variable. Help!</p>
  
  <p>Here's my code:</p>
  
  <pre><code>add_action('admin_menu', array(&amp;$this, 'add_psc_menu_page'));
  function add_psc_menu_page(){
      add_submenu_page('edit.php?post_type=my-custom-post-type','Sub Menu','Sub Menu Title','manage_options','my-custom-post-type', array(&amp;$this, 'render_psc_sub_page'));
  }
  function render_psc_sub_page(){
      include(PSC_PLUGIN_URL.'/util/custom-post-submenu-page.php');
  }
  </code></pre>
  
  <p>And in the submenu php file, trying to access a variable I KNOW is set like:</p>
  
  <pre><code>$this-&gt;plugin_activated
  </code></pre>
  
  <p>blows up with this error:</p>
  
  <pre><code>Fatal error: Using $this when not in object context
  </code></pre>
  
  <p>and trying to access the plugin constants like</p>
  
  <pre><code>PSC_PLUGIN_URL
  </code></pre>
  
  <p>give an error:</p>
  
  <pre><code>Use of undefined constant PSC_PLUGIN_URL - assumed 'PSC_PLUGIN_URL'
  </code></pre>
  
  <p>I'm not sure how including the file in the submenu of a custom post throws things out of context, when I can create regular menus with no issues. However, I'd rather nest several menu items under the custom post type.</p>
  
  <p>Could you point my in the right direction on how to get this submenu page to access $this and the rest of the plugin? Any help would be greatly appreciated. Thanks.</p>