WordPress.org

Plugin Directory

Changeset 617520


Ignore:
Timestamp:
10/25/12 21:16:37 (18 months ago)
Author:
andy
Message:

Jetpack Notes: add an admin URL that redirects to the connect URL for user linking. allows removing at least one step from the account linking process. might also allow linking entirely within the iframe.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jetpack/trunk/jetpack.php

    r617385 r617520  
    16351635            // Should only be used in intermediate redirects to preserve state across redirects 
    16361636            Jetpack::restate(); 
     1637        } 
     1638 
     1639        if ( isset( $_GET['connect_url_redirect'] ) ) { 
     1640            // User clicked in the iframe to link their accounts 
     1641            if ( ! Jetpack::is_user_connected() ) { 
     1642                $connect_url = Jetpack::build_connect_url( true ); 
     1643                if ( isset( $_GET['notes_iframe'] ) ) 
     1644                    $connect_url .= '&notes_iframe'; 
     1645                wp_redirect( $connect_url ); 
     1646                exit; 
     1647            } else { 
     1648                Jetpack::state( 'message', 'already_authorized' ); 
     1649                wp_safe_redirect( Jetpack::admin_url() ); 
     1650                exit; 
     1651            } 
    16371652        } 
    16381653 
Note: See TracChangeset for help on using the changeset viewer.