WooCommerce Code Reference

RedirectionController
in package

Handle redirecting to the old or new editor based on features and support.

Tags
deprecated
10.9.0

Product editor extension APIs will be removed in WooCommerce 11.0.

Table of Contents

$product_templates  : array<string|int, mixed>
Registered product templates.
__construct()  : mixed
Set up the hooks used for redirection.
maybe_redirect_to_new_editor()  : void
Redirects from old product form to the new product form if the feature `product_block_editor` is enabled.
maybe_redirect_to_old_editor()  : void
Redirects from new product form to the old product form if the feature `product_block_editor` is enabled.
redirect_non_supported_product_types()  : void
Redirect non supported product types to legacy editor.
set_product_templates()  : void
Check if a product is supported by the new experience.
get_parsed_route()  : array<string|int, mixed>
Get the parsed WooCommerce Admin path.
is_legacy_add_new_screen()  : bool
Check if the current screen is the legacy add product screen.
is_legacy_edit_screen()  : bool
Check if the current screen is the legacy edit product screen.
is_product_supported()  : bool
Check if a product is supported by the new experience.

Properties

Methods

set_product_templates()

Check if a product is supported by the new experience.

public set_product_templates(array<string|int, mixed> $product_templates) : void
Parameters
$product_templates : array<string|int, mixed>

The registered product templates.

Return values
void