Skip to content
This repository was archived by the owner on Sep 6, 2024. It is now read-only.

Commit 6bb1107

Browse files
authored
Merge pull request #252 from Automattic/fix/wcpay-features
Only load WCPay features when requested
2 parents 38411df + b13682e commit 6bb1107

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

features/woocommerce-payments.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,18 @@ function ( $defaults ) {
5050
'jurassic_ninja_rest_create_request_features',
5151
function ( $features, $json_params ) {
5252
if ( isset( $json_params['woocommerce-payments-dev-tools'] ) ) {
53-
$features['woocommerce-payments-dev-tools'] = true;
53+
$features['woocommerce-payments-dev-tools'] = $json_params['woocommerce-payments-dev-tools'];
5454
}
5555

5656
if ( isset( $json_params['woocommerce-payments-jn-options'] ) ) {
57-
$features['woocommerce-payments-jn-options'] = true;
57+
$features['woocommerce-payments-jn-options'] = $json_params['woocommerce-payments-jn-options'];
5858
}
5959

6060
if ( isset( $json_params['woocommerce-payments-release'] ) ) {
6161
$features['woocommerce-payments-release'] = $json_params['woocommerce-payments-release'];
62-
$features['woocommerce'] = true;
62+
if ( $features['woocommerce-payments-release'] ) {
63+
$features['woocommerce'] = true;
64+
}
6365
}
6466

6567
return $features;

0 commit comments

Comments
 (0)