title: Redirect from add_menu_page
body: <p>I have added a menu using add_menu_page which all works correctly, but when clicked I want this menu page to open the post editor for a particular post id.</p>
  
  <p>As a proof of concept i have tried echoing a javascript redirect out into the do function like so...</p>
  
  <pre><code>// Load up the menu page
   function register_availability_custom_menu_page() {
     add_menu_page('custom menu title', 'Availability', 'add_users', 'options',             'options_do_page');
  }
  
  function options_do_page() {
  echo "&lt;script type=\"text/javascript\"&gt;";
  echo "window.location = '/whatever_page.php';";
  echo "&lt;/script&gt;";
  }
  </code></pre>
  
  <p>This approach does work but I was wondering if it is the best approach, is there a better way to redirect to the page I am after?</p>
  
  <h2>UPDATE</h2>
  
  <p>I have now also tried using wp_redirect with this code...</p>
  
  <pre><code>add_action( 'admin_menu' , 'admin_menu_new_items' );
  
  function admin_menu_new_items() {
      wp_redirect( home_url() );
      exit;
  }
  </code></pre>
  
  <p>This gives me a Headers already sent error, can anyone suggest where I am going wrong?</p>