title: use wp_send_json() | wp_die() | die() in external function
body: <p>I try to accomplish the following structure</p>
  
  <pre><code>add_action('wp_ajax_theaction','theaction');
  function theaction () {
      $input = $_POST['input'];
      do_action('thehook',$input);
  }
  </code></pre>
  
  <p>Other php file</p>
  
  <pre><code>add_action('thehook','doit');
  function doit ($input) {
      $output = array('hello',$input);
      wp_send_json($output);
  }
  </code></pre>
  
  <p>My code works great if I don't go via a custom hook, but as shown above, the ajax call returns an empty string.</p>