title: Paid membership pro plugin function hide ads displays on frontend
body: <p>Paid Membership Pro plugin for wordpress has a function to Hide Ads for Member Specific levels or for all members. The code they give is this:</p>
  <pre><code>if ( function_exists( 'pmpro_displayAds' ) &amp;&amp; pmpro_displayAds() ) {
  //insert ad code here }`
  </code></pre>
  <p>I add my ad code with my ads code but the function is displaying same on the frontend.</p>
  <p>Someone here on StackOverflow suggests using code like this</p>
  <pre><code>&lt;?php 
  if ( function_exists( 'pmpro_displayAds' ) &amp;&amp; pmpro_displayAds() ) { 
      echo('&lt;script async type=&quot;application/javascript&quot; src=&quot;https://delivery.gettopple.com/ad-provider.js&quot;&gt;&lt;/script&gt; &lt;ins class=&quot;adsbytopple&quot; data-zoneid=&quot;36&quot;&gt;&lt;/ins&gt; &lt;script&gt;(AdProvider = window.AdProvider || []).push({&quot;serve&quot;: {}});&lt;/script&gt;');  
  }  
  ?&gt;
  </code></pre>
  <p>Now code is not displaying on the frontend but I am still getting this line on frontend</p>
  <pre><code>); } ?&gt;
  </code></pre>
  <p>Here is the screenshot of the issue:
  <a href="https://i.stack.imgur.com/TUjwn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TUjwn.png" alt="issue" /></a></p>
  <p>I tried some other variations from PMP too but didn't work.</p>