Automattic\WooCommerce\Admin\Features\ProductBlockEditor

RedirectionController::redirect_non_supported_product_types()publicWC 1.0

Redirect non supported product types to legacy editor.

Method of the class: RedirectionController{}

No Hooks.

Return

null. Nothing (null).

Usage

$RedirectionController = new RedirectionController();
$RedirectionController->redirect_non_supported_product_types(): void;

RedirectionController::redirect_non_supported_product_types() code WC 9.7.1

public function redirect_non_supported_product_types(): void {
	$route      = $this->get_parsed_route();
	$product_id = $route['product_id'];

	if ( 'product' === $route['page'] && ! $this->is_product_supported( $product_id ) ) {
		wp_safe_redirect( admin_url( 'post.php?post=' . $route['product_id'] . '&action=edit' ) );
		exit();
	}
}