Add hash to redirect url

edited November 2016 in WordPress
Is there a way with a hook to append a hash tag to the end of the url?

Answers

  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    edited November 2016
    Hi Robert,

    here is what I have send you by email:

    For WordPress you can use a filter.
    The following function should do the trick:


    function oa_social_login_redirect_url ($redirect_to, $user_data) { // Remove existing hash $redirect_to = strstr($redirect_to, '#', true); // Add new $redirect_to = $redirect_to .'#my-hash-here'; // Done return $redirect_to; } add_filter('oa_social_login_filter_registration_redirect_url', 'oa_social_login_redirect_url'); add_filter('oa_social_login_filter_login_redirect_url', 'oa_social_login_redirect_url');

  • Can this be used to grab from the user_data variable the social platform the login user used? I need to push the redirect to a specific page that is dedicated to the social platform.

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.