Fix signature mismatch in WC CLI command api calls (#36240)

This commit is contained in:
Thilina Pituwala 2023-01-02 11:34:20 +01:00 committed by GitHub
parent 0d641253ac
commit a633ff8abf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fix the signature mismatch affecting wc cli commands ability to fetch user subscription data.

View File

@ -1280,6 +1280,8 @@ class WC_Helper {
$source = 'inbox-notes'; $source = 'inbox-notes';
elseif ( stripos( $request_uri, 'admin-ajax.php' ) ) : elseif ( stripos( $request_uri, 'admin-ajax.php' ) ) :
$source = 'heartbeat-api'; $source = 'heartbeat-api';
elseif ( defined( 'WP_CLI' ) && WP_CLI ) :
$source = 'wc-cli';
endif; endif;
// Obtain the connected user info. // Obtain the connected user info.
@ -1287,7 +1289,7 @@ class WC_Helper {
'subscriptions', 'subscriptions',
array( array(
'authenticated' => true, 'authenticated' => true,
'query_string' => esc_url( '?source=' . $source ), 'query_string' => '' !== $source ? esc_url( '?source=' . $source ) : '',
) )
); );