use add_query_arg to determine current page url

This commit is contained in:
haszari 2019-07-15 18:07:57 +12:00
parent f97fa34c01
commit dab7cb328a
1 changed files with 4 additions and 2 deletions

View File

@ -483,10 +483,12 @@ class WC_Admin_Addons {
* Returns in-app-purchase URL params.
*/
public static function get_in_app_purchase_url_params() {
$back_admin_path = isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
// Get url (from path onward) for the current page,
// so WCCOM "back" link returns user to where they were.
$back_admin_path = add_query_arg( array() );
return array(
'in-app-purchase-site' => site_url(),
'in-app-purchase-back' => $back_admin_path,
'in-app-purchase-back' => esc_url( $back_admin_path ),
'in-app-purchase-woo-version' => WC_VERSION,
);
}