[LYS] - Make sure LYS options are available for WooPayments (#47685)
* add viz options on wcpay screens * Add changefile(s) from automation for the following project(s): woocommerce * cleanup * lint * wp_unslash lint errors * disable * linter * more linting --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
fb2b79f502
commit
01bfab0527
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: add
|
||||
Comment: Adds to previously unreleased feature
|
||||
|
|
@ -81,7 +81,14 @@ class LaunchYourStore {
|
|||
$current_screen = get_current_screen();
|
||||
$is_setting_page = $current_screen && 'woocommerce_page_wc-settings' === $current_screen->id;
|
||||
|
||||
if ( $is_setting_page ) {
|
||||
// phpcs:disable WordPress.Security.NonceVerification.Recommended
|
||||
$is_woopayments_connect = isset( $_GET['path'] ) &&
|
||||
isset( $_GET['page'] ) &&
|
||||
( '/payments/connect' === sanitize_text_field( wp_unslash( $_GET['path'] ) ) || '/payments/onboarding' === sanitize_text_field( wp_unslash( $_GET['path'] ) ) ) &&
|
||||
'wc-admin' === $_GET['page'];
|
||||
// phpcs:enable
|
||||
|
||||
if ( $is_setting_page || $is_woopayments_connect ) {
|
||||
// Regnerate the share key if it's not set.
|
||||
add_option( 'woocommerce_share_key', wp_generate_password( 32, false ) );
|
||||
|
||||
|
|
Loading…
Reference in New Issue