Automattic\WooCommerce\Admin\Features\ProductBlockEditor
RedirectionController::maybe_redirect_to_old_editor()
Redirects from new product form to the old product form if the feature product_block_editor is enabled.
Method of the class: RedirectionController{}
No Hooks.
Return
null
. Nothing (null).
Usage
$RedirectionController = new RedirectionController(); $RedirectionController->maybe_redirect_to_old_editor(): void;
RedirectionController::maybe_redirect_to_old_editor() RedirectionController::maybe redirect to old editor code WC 9.7.1
public function maybe_redirect_to_old_editor(): void { $route = $this->get_parsed_route(); if ( 'add-product' === $route['page'] ) { wp_safe_redirect( admin_url( 'post-new.php?post_type=product' ) ); exit(); } if ( 'product' === $route['page'] ) { wp_safe_redirect( admin_url( 'post.php?post=' . $route['product_id'] . '&action=edit' ) ); exit(); } }