Disable image regen if photon is being used.
This commit is contained in:
parent
1961076bf7
commit
66e65cf7bf
|
@ -182,6 +182,11 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Jetpack does the image resizing heavy lifting so you don't have to.
|
||||||
|
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
|
||||||
|
unset( $tools['regenerate_thumbnails'] );
|
||||||
|
}
|
||||||
|
|
||||||
return apply_filters( 'woocommerce_debug_tools', $tools );
|
return apply_filters( 'woocommerce_debug_tools', $tools );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -325,4 +325,4 @@ class WC_Regenerate_Images {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
add_action( 'init', array( 'WC_Regenerate_Images', 'init' ) );
|
WC_Regenerate_Images::init();
|
||||||
|
|
|
@ -325,7 +325,6 @@ final class WooCommerce {
|
||||||
include_once WC_ABSPATH . 'includes/class-wc-discounts.php';
|
include_once WC_ABSPATH . 'includes/class-wc-discounts.php';
|
||||||
include_once WC_ABSPATH . 'includes/class-wc-cart-totals.php';
|
include_once WC_ABSPATH . 'includes/class-wc-cart-totals.php';
|
||||||
include_once WC_ABSPATH . 'includes/customizer/class-wc-shop-customizer.php';
|
include_once WC_ABSPATH . 'includes/customizer/class-wc-shop-customizer.php';
|
||||||
include_once WC_ABSPATH . 'includes/class-wc-regenerate-images.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data stores - used to store and retrieve CRUD object data from the database.
|
* Data stores - used to store and retrieve CRUD object data from the database.
|
||||||
|
@ -482,6 +481,11 @@ final class WooCommerce {
|
||||||
|
|
||||||
$this->load_webhooks();
|
$this->load_webhooks();
|
||||||
|
|
||||||
|
// Unless Jetpack Photon is running, let's include our regenerate thumbnails class.
|
||||||
|
if ( ! class_exists( 'Jetpack' ) || ! Jetpack::is_module_active( 'photon' ) ) {
|
||||||
|
include_once WC_ABSPATH . 'includes/class-wc-regenerate-images.php';
|
||||||
|
}
|
||||||
|
|
||||||
// Init action.
|
// Init action.
|
||||||
do_action( 'woocommerce_init' );
|
do_action( 'woocommerce_init' );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue