WooCommerce Code Reference

Init
in package

Loads assets related to the product block editor.

Table of Contents

EDITOR_CONTEXT_NAME  = 'woocommerce/edit-product'
The context name used to identify the editor.
$redirection_controller  : RedirectionController
Redirection controller.
$supported_post_types  : array<string|int, mixed>
Supported post types.
__construct()  : mixed
Constructor
add_product_template()  : array<string|int, mixed>
Enqueue styles needed for the rich text editor.
dequeue_conflicting_styles()  : mixed
Dequeue conflicting styles.
enqueue_scripts()  : mixed
Enqueue scripts needed for the product form block editor.
enqueue_styles()  : mixed
Enqueue styles needed for the rich text editor.
set_current_screen_to_block_editor_if_wc_admin()  : mixed
Sets the current screen to the block editor if a wc-admin page.
update_edit_product_link()  : string
Update the edit product links when the new experience is enabled.
get_resolved_assets()  : array<string|int, mixed>
Get the resolved assets needed for the iframe editor.

Constants

Properties

Methods

add_product_template()

Enqueue styles needed for the rich text editor.

public add_product_template(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>

Array of post type arguments.

Return values
array<string|int, mixed>Array of post type arguments.

set_current_screen_to_block_editor_if_wc_admin()

Sets the current screen to the block editor if a wc-admin page.

public set_current_screen_to_block_editor_if_wc_admin() : mixed
Return values
mixed

Update the edit product links when the new experience is enabled.

public update_edit_product_link(string $link, int $post_id) : string
Parameters
$link : string

The edit link.

$post_id : int

Post ID.

Return values
string

get_resolved_assets()

Get the resolved assets needed for the iframe editor.

private get_resolved_assets() : array<string|int, mixed>
Return values
array<string|int, mixed>Styles and scripts.