title: How to edit a post dynamically in wordpress plugin
body: <p>I have created a small wordpress plugin that displays a list of people in a page via shortcode.</p>
  
  <p>When the user clicks on one of the names from the list, a query_var gets set and my plugin catches the $_GET with the specific id of the person the user just clicked. All very well until now.</p>
  
  <p>My problem is that now I want to display a page with the details (for the clicked element) but I dont seem to be able to edit the content or post that gets to the page and it returns me to the page with the list of people. </p>
  
  <p>My question is how do I edit the post? I have tried adding a add_filter('the_content','my_func') to this, but this does not work since this hook is probably already passed. </p>
  
  <p>I can access the post directly via get_content() or get_post(), but I dont seem to be able to make the page populated new data.</p>
  
  <p>In other words... this does nore seem to work</p>
  
  <pre><code>$fid = $_GET['fid'];
  global $wpdb;
  $sql = "select * from fighters where fighter_id = {$fid} limit 1";
  $fighter = $wpdb-&gt;get_row($sql);
  
  $html = $this-&gt;_getFighterPageLayout($fighter);
  
  $post = get_post();
  $post-&gt;post_content = $html;
  $post-&gt;title = 'test';
  $post-&gt;private = false;
  // or even just global $content = $html;
  </code></pre>
  
  <p>What am I doing wrong and what ways do I have to edit/update the content/post?</p>