Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jetpack: build_connect_url() #5319

Merged
merged 1 commit into from Oct 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion class.jetpack.php
Expand Up @@ -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',
Expand All @@ -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' ),
Expand Down