title: Wordpress: building shortcode content in an external page causes error?
body: <p>I'm trying to build my own Wordpress Plugin and right now I'm stuck in creating my shortcode (everything else in the backend works just fine). Basically Im trying to set up the code like:</p>
  
  <pre><code>//Function to display the shortcode
  function my_shortcode($atts) {
    include 'my_shortcode_content.php';
  } 
  </code></pre>
  
  <p>As you can see I am trying to just simply include the content from an external php file and not write it directly into the function. </p>
  
  <p>The <code>my_shortcode_content.php</code> looks like this:</p>
  
  <pre><code>&lt;?php
      global $wpdb;
  
      $table_name = $wpdb-&gt;prefix . "test";
      $table_name_categories = $wpdb-&gt;prefix . "test_categories";
      $stuff = $wpdb-&gt;get_results("SELECT * FROM ".$table_name);
      $categories = $wpdb-&gt;get_results("SELECT * FROM ".$table_name_categories);
  
      echo "&lt;div&gt;Test&lt;/div&gt;";
  ?&gt;
  </code></pre>
  
  <p>Now the problem is that when I try to echo my HTML Code or even try to put the raw HTML Code outside the -tag I cannot edit my page anymore. </p>
  
  <p>Everytime I try to edit the page in wordpress (where I have my shortcode implemented in a simple text field) and hit save, it only tells me that the update failed and the changes I made in my page are not saved. Now the weird thing is, if I add stuff to my shortcode content file it will display the change on the page, but if I want to remove / edit something else that is not my shortcode, I simply can't because it throws me an error. BUT if I remove the HTML Code from my shortcode content page, everything works just fine and I can edit my page again.</p>
  
  <p>Does anyone know how what could cause this problem?</p>
  
  <p>Btw I'm using docker-wordpress to test my stuff, tho I do not think that this could cause the error.</p>