diff --git a/class.jetpack.php b/class.jetpack.php index a48a2be9aca22..d48266c70c793 100644 --- a/class.jetpack.php +++ b/class.jetpack.php @@ -3848,6 +3848,17 @@ function build_connect_url( $raw = false, $redirect = false, $from = false ) { ? get_site_icon_url() : false; + /** + * Filter the type of authorization. + * 'calypso' completes authorization on wordpress.com/jetpack/connect + * while 'jetpack' ( or any other value ) completes the authorization at jetpack.wordpress.com. + * + * @since 4.3.3 + * + * @param string $auth_type Defaults to 'calypso', can also be 'jetpack'. + */ + $auth_type = apply_filters( 'jetpack_auth_type', 'calypso' ); + $args = urlencode_deep( array( 'response_type' => 'code', @@ -3866,7 +3877,7 @@ function build_connect_url( $raw = false, $redirect = false, $from = false ) { 'user_login' => $user->user_login, 'is_active' => Jetpack::is_active(), 'jp_version' => JETPACK__VERSION, - 'auth_type' => 'calypso', + 'auth_type' => $auth_type, 'secret' => $secret, 'locale' => isset( $gp_locale->slug ) ? $gp_locale->slug : '', 'blogname' => get_option( 'blogname' ),