Skip to content

Commit

Permalink
Preload Jetpack data even without Jetpack plugin installed (woocommer…
Browse files Browse the repository at this point in the history
…ce#41092)

* Preload Jetpack data even without Jetpack plugin installed

Now that the Jetpack Connection package is a dependency
of WooCommerce, preload Jetpack data even when the Jetpack
plugin is not present.

Fixes woocommerce#41070

* Add changefile(s) from automation for the following project(s): woocommerce

* Fix lint issue

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Adrian Duffell <[email protected]>
  • Loading branch information
3 people authored Nov 1, 2023
1 parent ac76d8c commit 4423117
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Preload Jetpack-related data from the Jetpack Connection package
4 changes: 1 addition & 3 deletions plugins/woocommerce/src/Internal/Admin/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,7 @@ public static function add_component_settings( $settings ) {
}

$preload_data_endpoints = apply_filters( 'woocommerce_component_settings_preload_endpoints', array() );
if ( class_exists( 'Jetpack' ) ) {
$preload_data_endpoints['jetpackStatus'] = '/jetpack/v4/connection';
}
$preload_data_endpoints['jetpackStatus'] = '/jetpack/v4/connection';
if ( ! empty( $preload_data_endpoints ) ) {
$preload_data = array_reduce(
array_values( $preload_data_endpoints ),
Expand Down
4 changes: 1 addition & 3 deletions plugins/woocommerce/src/Internal/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ public function add_component_settings( $settings ) {

//phpcs:ignore
$preload_data_endpoints = apply_filters( 'woocommerce_component_settings_preload_endpoints', array() );
if ( class_exists( 'Jetpack' ) ) {
$preload_data_endpoints['jetpackStatus'] = '/jetpack/v4/connection';
}
$preload_data_endpoints['jetpackStatus'] = '/jetpack/v4/connection';
if ( ! empty( $preload_data_endpoints ) ) {
$preload_data = array_reduce(
array_values( $preload_data_endpoints ),
Expand Down

0 comments on commit 4423117

Please sign in to comment.