Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #888111

    Hi there!

    Is there a workaround for getting the social share buttons to include the URL-query in the link-to-be-shared?

    Currently the link shared through the social share buttons only include the clean URL, and not any “?”-queries.

    Link for the website in question in Private Content.

    Please do let me know if you’ll be needing login-/ftp-access, or further info :)

    Thank you so much in advance!

    • This topic was modified 6 years, 5 months ago by transdesign_dk. Reason: Debug added
    #888724

    Hey Martin,

    Thank you for using Enfold.

    You can use the “avia_social_share_link_replace_values” to adjust the value of the default shortlink or permalink. The current value is based on the get_permalink function. Example:

    add_filter('avia_social_share_link_replace_values', 'avia_social_share_link_replace_values_mod');
    function avia_social_share_link_replace_values_mod($replace) {
    	$replace['shortlink'] = get_permalink(); // you can change this
            $replace['permalink'] = get_permalink(); // you can change this
    	return $replace;
    }

    Best regards,
    Ismael

    #888834

    Amazing, thank you so much!

    Can I assume this is quite safe (thinking XSS-exploits) to use, then?

    add_filter('avia_social_share_link_replace_values', 'avia_social_share_link_replace_values_mod');
    function avia_social_share_link_replace_values_mod($replace) {
    	$replace['shortlink'] = esc_url( $_SERVER['HTTP_HOST'] ) . esc_url( $_SERVER['REQUEST_URI'] ); // you can change this
            $replace['permalink'] = esc_url( $_SERVER['HTTP_HOST'] ) . esc_url( $_SERVER['REQUEST_URI'] ); // you can change this
    	return $replace;
    }
    #889458

    Hi,

    Can I assume this is quite safe (thinking XSS-exploits) to use, then?

    I’m sorry if I can’t comment on that. You should contact a consultant or a web security expert.

    Best regards,
    Ismael

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.