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
EDITOR_CONTEXT_NAME
The context name used to identify the editor.
public
mixed
EDITOR_CONTEXT_NAME
= 'woocommerce/edit-product'
Properties
$redirection_controller
Redirection controller.
private
RedirectionController
$redirection_controller
$supported_post_types
Supported post types.
private
array<string|int, mixed>
$supported_post_types
= array('simple')
Methods
__construct()
Constructor
public
__construct() : mixed
Return values
mixed —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.dequeue_conflicting_styles()
Dequeue conflicting styles.
public
dequeue_conflicting_styles() : mixed
Return values
mixed —enqueue_scripts()
Enqueue scripts needed for the product form block editor.
public
enqueue_scripts() : mixed
Return values
mixed —enqueue_styles()
Enqueue styles needed for the rich text editor.
public
enqueue_styles() : mixed
Return values
mixed —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_edit_product_link()
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>