WooCommerce Code Reference

AIPatterns
in package

AIPatterns class.

Table of Contents

PATTERNS_AI_DATA_POST_TYPE  = 'patterns_ai_data'
__construct()  : mixed
Constructor for the class.
register_patterns_ai_data_post_type()  : mixed
Register the Patterns AI Data post type to store patterns with the AI-generated content.
schedule_on_option_update()  : mixed
Update the patterns content when the store description is changed.
schedule_on_plugin_update()  : mixed
Update the patterns content when the WooCommerce Blocks plugin is updated.
schedule_patterns_content_update()  : mixed
Update the patterns content when the store description is changed.
update_ai_connection_allowed_option()  : bool
Make sure the 'woocommerce_blocks_allow_ai_connection' option is set to true if the site is connected to AI.
update_patterns_content()  : bool|string|WP_Error
Update the patterns content.

Constants

Methods

register_patterns_ai_data_post_type()

Register the Patterns AI Data post type to store patterns with the AI-generated content.

public register_patterns_ai_data_post_type() : mixed
Return values
mixed

schedule_on_option_update()

Update the patterns content when the store description is changed.

public schedule_on_option_update(string $option, string $value) : mixed
Parameters
$option : string

The option name.

$value : string

The option value.

Return values
mixed

schedule_on_plugin_update()

Update the patterns content when the WooCommerce Blocks plugin is updated.

public schedule_on_plugin_update(WP_Upgrader $upgrader_object, array<string|int, mixed> $options) : mixed
Parameters
$upgrader_object : WP_Upgrader

WP_Upgrader instance.

$options : array<string|int, mixed>

Array of bulk item update data.

Return values
mixed

schedule_patterns_content_update()

Update the patterns content when the store description is changed.

public schedule_patterns_content_update(string $business_description) : mixed
Parameters
$business_description : string

The business description.

Return values
mixed

update_ai_connection_allowed_option()

Make sure the 'woocommerce_blocks_allow_ai_connection' option is set to true if the site is connected to AI.

public update_ai_connection_allowed_option() : bool
Return values
bool

update_patterns_content()

Update the patterns content.

public update_patterns_content() : bool|string|WP_Error
Return values
bool|string|WP_Error