Add support to allow in-app purchase installation after connected.

This commit is contained in:
Akeda Bagus 2019-08-17 00:36:28 +07:00
parent f687412acd
commit aae802f319
No known key found for this signature in database
GPG Key ID: B21A9FC4B7761412
2 changed files with 11 additions and 3 deletions

View File

@ -487,9 +487,10 @@ class WC_Admin_Addons {
// so WCCOM "back" link returns user to where they were.
$back_admin_path = add_query_arg( array() );
return array(
'wccom-site' => site_url(),
'wccom-back' => esc_url( $back_admin_path ),
'wccom-woo-version' => WC_VERSION,
'wccom-site' => site_url(),
'wccom-back' => esc_url( $back_admin_path ),
'wccom-woo-version' => WC_VERSION,
'wccom-helper-nonce' => wp_create_nonce( 'connect' ),
);
}

View File

@ -799,6 +799,13 @@ class WC_Helper {
WC_Tracker::send_tracking_data( true );
}
// If connecting through in-app purchase, redirects back to WooCommerce.com
// for product installation.
if ( ! empty( $_GET['wccom-install-url'] ) ) {
wp_redirect( wp_unslash( $_GET['wccom-install-url'] ) );
exit;
}
wp_safe_redirect(
add_query_arg(
array(