l( 'post.php?post=' . $route['product_id'] . '&action=edit' ) ); exit(); } } /** * Get the parsed WooCommerce Admin path. */ protected function get_parsed_route(): array { if ( ! \Automattic\WooCommerce\Admin\PageController::is_admin_page() || ! isset( $_GET['path'] ) ) { return array( 'page' => null, 'product_id' => null, ); } $path = esc_url_raw( wp_unslash( $_GET['path'] ) ); $path_pieces = explode( '/', wp_parse_url( $path, PHP_URL_PATH ) ); return array( 'page' => $path_pieces[1], 'product_id' => 'product' === $path_pieces[1] ? absint( $path_pieces[2] ) : null, ); } /** * Redirect non supported product types to legacy editor. */ 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(); } } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Admin\Features\ProductBlockEditor\RedirectionController" not found in /htdocs/wp-content/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/Init.php:56 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/src/Admin/Features/Features.php(137): Automattic\WooCommerce\Admin\Features\ProductBlockEditor\Init->__construct() #1 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Admin\Features\Features::load_features('') #2 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /htdocs/wp-settings.php(695): do_action('init') #5 /htdocs/wp-config.php(178): require_once('/htdocs/wp-sett...') #6 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #7 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #8 /htdocs/index.php(17): require('/htdocs/wp-blog...') #9 {main} thrown in /htdocs/wp-content/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/Init.php on line 56