WordPress.org

Making WordPress.org

Changeset 6661


Ignore:
Timestamp:
02/16/2018 07:25:45 AM (20 months ago)
Author:
obenland
Message:

SSO: Always pass locale information.

Makes sure the locale context remains maintained throughout the registration/login process.

H/t ocean90.
Fixes #1673.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/common/includes/wporg-sso/wp-plugin.php

    r6646 r6661  
    5454
    5555                add_filter( 'pre_site_option_registration', array( $this, 'inherit_registration_option' ) );
     56
     57                add_filter( 'login_url', [$this, 'add_locale'], 21 );
     58                add_filter( 'register_url', [$this, 'add_locale'], 21 );
     59                add_filter( 'lostpassword_url', [$this, 'add_locale'], 21 );
    5660            }
    5761        }
     
    323327
    324328        /**
     329         * Adds a locale parameter to the passed URL.
     330         *
     331         * @param string $url The URL.
     332         * @return string
     333         */
     334        public function add_locale( $url ) {
     335            return add_query_arg( 'locale', get_locale(), $url );
     336        }
     337
     338        /**
    325339         * Redirects the user to her/his (support) profile.
    326340         */
Note: See TracChangeset for help on using the changeset viewer.