-3

I stored the url in Database https://example.in/register/?ref=[affiliate_id] and I tried to get the affiliate id of current logged in user.But I am unable to get the value when I print it. But if I used as directly like using $val = do_shortcode('[[affiliate_id]'); I am getting the value. Please solve my issue

1 Answers1

0

I am not sure but use below code it might be resolved your problem

 add_action('init','runShortcode');

 function runShortcode(){
  $getCode = $_request['ref'];
  If($getCode)
  {
     $shirtcodes = '['.$getCode.']';

     echo do_shortcode($shirtcides);
  }

Not sure with code

Akshay Shah
  • 3,391
  • 2
  • 20
  • 33