0

I have a shortcode that restricts content in wordpress. which first hides content and shows the message and after buying product it shows the sample restricted text.

[edd_restrict id="any"]sample restricted text [/edd_restrict]

This just work for sample TEXT. I converted it to PHP like this :

<?php echo do_shortcode( '[edd_restrict id="any"]<?php include(TEMPLATEPATH."/post-ads.php");?>[/edd_restrict]' );?>

But in this way it shows a message to buy a product but after buying product it can not run the PHP inside I mean <?php include(TEMPLATEPATH."/post-ads.php");?> and shows nothing. is there any way to run this PHP into <?php echo do_shortcode ?

Kay Angevare
  • 639
  • 6
  • 17
Hamoon
  • 1
  • 3
  • Am I correct if I think that you're trying to include a template on the page once a user has bought a certain product? – Kay Angevare Aug 15 '22 at 08:56
  • 1
    yes. i want to show him post-ads.php when he bought a product. but edd just restricst texts with shortcode not a php file – Hamoon Aug 15 '22 at 10:13

0 Answers0