WordPress at Your Fingertips
function is not described

WC_Regenerate_Images::init() public WC 1.0

Init function

{} It's a method of the class: WC_Regenerate_Images{}

Return

null. Nothing.

Usage

$result = WC_Regenerate_Images::init();

Code of WC_Regenerate_Images::init() WC 5.9.0

public static function init() {
	add_action( 'image_get_intermediate_size', array( __CLASS__, 'filter_image_get_intermediate_size' ), 10, 3 );
	add_filter( 'wp_generate_attachment_metadata', array( __CLASS__, 'add_uncropped_metadata' ) );
	add_filter( 'wp_get_attachment_image_src', array( __CLASS__, 'maybe_resize_image' ), 10, 4 );

	// Not required when Jetpack Photon is in use.
	if ( method_exists( 'Jetpack', 'is_module_active' ) && Jetpack::is_module_active( 'photon' ) ) {
		return;
	}

	if ( apply_filters( 'woocommerce_background_image_regeneration', true ) ) {
		include_once WC_ABSPATH . 'includes/class-wc-regenerate-images-request.php';

		self::$background_process = new WC_Regenerate_Images_Request();

		add_action( 'admin_init', array( __CLASS__, 'regenerating_notice' ) );
		add_action( 'woocommerce_hide_regenerating_thumbnails_notice', array( __CLASS__, 'dismiss_regenerating_notice' ) );

		// Regenerate thumbnails in the background after settings changes. Not ran on multisite to avoid multiple simultanious jobs.
		if ( ! is_multisite() ) {
			add_action( 'customize_save_after', array( __CLASS__, 'maybe_regenerate_images' ) );
			add_action( 'after_switch_theme', array( __CLASS__, 'maybe_regenerate_images' ) );
		}
	}
}