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.
Метод класса: RedirectionController{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$RedirectionController = new RedirectionController(); $RedirectionController->maybe_redirect_to_old_editor(): void;
Код RedirectionController::maybe_redirect_to_old_editor() RedirectionController::maybe redirect to old editor 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(); } }