Automattic\WooCommerce\Admin\Features\ProductBlockEditor
RedirectionController::redirect_non_supported_product_types
Redirect non supported product types to legacy editor.
Method of the class: RedirectionController{}
No Hooks.
Returns
null. Nothing (null).
Usage
$RedirectionController = new RedirectionController(); $RedirectionController->redirect_non_supported_product_types(): void;
RedirectionController::redirect_non_supported_product_types() RedirectionController::redirect non supported product types code WC 10.5.0
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();
}
}