Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Use wp_login_url instead of hardcoding login path (#3090)
Browse files Browse the repository at this point in the history
* use wp_login_url instead of hardcoding login path

* generating changeset for pull request

* generating changeset for pull request

Co-authored-by: github-actions <github-actions@github.com>
  • Loading branch information
senadir and github-actions committed Sep 1, 2020
1 parent ce4c242 commit 22d3d15
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion assets/js/blocks/cart-checkout/checkout/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
export const LOGIN_TO_CHECKOUT_URL = `/wp-login.php?redirect_to=${ encodeURIComponent(
/**
* External dependencies
*/
import { LOGIN_URL } from '@woocommerce/block-settings';

export const LOGIN_TO_CHECKOUT_URL = `${ LOGIN_URL }?redirect_to=${ encodeURIComponent(
window.location.href
) }`;
1 change: 1 addition & 0 deletions assets/js/settings/blocks/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,4 @@ export const CHECKOUT_ALLOWS_SIGNUP = getSetting(
'checkoutAllowsSignup',
false
);
export const LOGIN_URL = getSetting( 'loginUrl', '/wp-login.php' );
1 change: 1 addition & 0 deletions src/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public static function get_wc_block_data( $settings ) {
'baseLocation' => wc_get_base_location(),
'woocommerceBlocksPhase' => WOOCOMMERCE_BLOCKS_PHASE,
'hasDarkEditorStyleSupport' => current_theme_supports( 'dark-editor-style' ),
'loginUrl' => wp_login_url(),

/*
* translators: If your word count is based on single characters (e.g. East Asian characters),
Expand Down

0 comments on commit 22d3d15

Please sign in to comment.