WooCommerce Code Reference

ProductFormsController
in package

Handle retrieval of product forms.

Table of Contents

$product_form_templates  : array<string|int, mixed>
Product form templates.
init()  : mixed
Set up the product forms controller.
migrate_product_form_posts()  : void
Create ot update a product_form post for each product form template.
migrate_templates_when_plugin_updated()  : void
Migrate form templates after WooCommerce plugin update.

Properties

Methods

migrate_product_form_posts()

Create ot update a product_form post for each product form template.

public migrate_product_form_posts(string $action) : void

If the post already exists, it will be updated. If the post does not exist, it will be created even if the action is update.

Parameters
$action : string
  • The action to perform. insert | update.
Return values
void

migrate_templates_when_plugin_updated()

Migrate form templates after WooCommerce plugin update.

public migrate_templates_when_plugin_updated(WP_Upgrader $upgrader, array<string|int, mixed> $hook_extra) : void
Parameters
$upgrader : WP_Upgrader

The WP_Upgrader instance.

$hook_extra : array<string|int, mixed>

Extra arguments passed to hooked filters.

Return values
void