• Resolved ramya

    (@ramyasam)


    I have a referral link in that format
    $referral_url = add_query_arg(apply_filters(‘referral_handel’, ‘ref’), $user->ID,

    I tried this but it not work
    [TheChamp-Sharing type=”vertical” url=”$referral_url”]

    what is the correct shortcode?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Heateor Support

    (@heateor)

    Shortcode won’t accept PHP variables. If you have to use PHP code in the shortcode, you can use the shortcode in the PHP template of the desired web page as echo do_shortcode('[TheChamp-Sharing type="vertical" url="'.$referral_url.'"]');

    Thread Starter ramya

    (@ramyasam)

    yes this code works
    but in some social share options, it copies the page link instead of the referral link example copy link, email

    Plugin Author Heateor Support

    (@heateor)

    You need to check how you are calculating value of $referral_url

    Thread Starter ramya

    (@ramyasam)

    $user_id = get_current_user_id();
    $user = new WP_User($user_id);
    $referral_url_by_userid = ‘id’ === $settings[‘referal_link’] ? true : false;
    $referral_url = add_query_arg($referral->referral_handel, $user->user_login, wc_get_page_permalink(‘myaccount’));
    if ($referral_url_by_userid) {
    $referral_url = add_query_arg($referral->referral_handel, $user->ID, wc_get_page_permalink(‘myaccount’));
    }

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘url social share’ is closed to new replies.