title: Use PHP in a Shortcode to pull content from specific post ID
body: <p>I am trying to create a shortcode that references content from a specific post ID. I have the code referenced below. It's set up so that if someone clicks the button, it will reveal content from the popup-id that will be defined in the shortcode. The popup-id is linked to a specific page/post.</p>
  <pre><code>function subscribe_link_att($atts, $content = null) {
     
      $default = array(
          'link' =&gt; '#',
          'popup-id' =&gt; '4582'
      );
      $a = shortcode_atts($default, $atts);
      $content = do_shortcode($content);
      
          
      return '&lt;button class=&quot;popup_button&quot;&gt; &lt;a href=&quot;#&quot; class=&quot;show&quot; data-id=&quot;'.($a['popup-id']).'&quot;&gt;&lt;span class=&quot;text&quot;&gt;'.$content.'&lt;/span&gt;&lt;/a&gt;&lt;/button&gt;
      &lt;div id=&quot;'.($a['popup-id']).'&quot; style=&quot;display: none&quot; class=&quot;hide&quot;&gt; 
  
          &lt;div class=&quot;social-popup-inner&quot;&gt;
               &lt;a href=&quot;#&quot; class=&quot;hide&quot; data-id=&quot;'.($a['popup-id']).'&quot;&gt;&lt;img id=&quot;social-popup-close&quot; src=&quot;/wp-content/themes/huh/_static/images/close-button.svg&quot; alt=&quot;close&quot;&gt;&lt;/a&gt;
          &lt;?php 
                  $popup = get_post('.($a['popup-id']).'); 
                  echo $popup-&gt;post_content;
              ?&gt;
          &lt;/div&gt;
       &lt;/div&gt;
      ';
      
  }
  add_shortcode('subscribe', 'subscribe_link_att');
  </code></pre>
  <p>The issue is that when I click the button, the content isn't pulling through (it just saying post_content; ?&gt;).</p>
  <p><a href="https://i.stack.imgur.com/C3FK7.png" rel="nofollow noreferrer">It looks like the PHP code is being commented out (screenshot hyperlinked here)</a>
  I would love any feedback or direction.</p>
  <p>I have a sample page here that I am playing with . It's formatted poorly but it's just for me to test things out in. The button called &quot;TEXT HERE&quot; is the button I am working on.</p>
  <p><a href="https://heyuhuman.com/melissa-test/" rel="nofollow noreferrer">https://heyuhuman.com/melissa-test/</a></p>
  <p>THANK YOU SO MUCH</p>