Hooks reference

Every action and filter the plugins provide, in pipeline order, with examples you can copy.

FreePro

Providers

FilterArgumentsUse
siteryn_ai_product_content_providers$providersRegister providers (id ⇒ ProviderInterface)
siteryn_ai_product_content_provider_configProviderConfig $configThe config used to generate (not for tests or model lists)
siteryn_ai_product_content_max_retries$retries, $provider_id0–2 retries (default 1)
siteryn_ai_product_content_allow_private_endpointfalse, $urlAllow a private-network endpoint
siteryn_ai_product_content_allow_insecure_local_endpointfalse, $urlAllow plain HTTP to localhost, 127.0.0.1 or ::1

Generation (in order)

HookArgumentsUse
siteryn_ai_product_content_content_types$typesAdd or change content types
siteryn_ai_product_content_product_context$context, $product, $allowed_fieldsThe product data sent
siteryn_ai_product_content_generation_options$clean, $raw, $typeAccept options from the panel; return the merged $clean
siteryn_ai_product_content_subject_locale$locale, $subjectOutput language
siteryn_ai_product_content_template_path$path, $nameUse your own prompt template
siteryn_ai_product_content_system_rules$rules, $type, $optionsAdd or change system rules (keyed array)
siteryn_ai_product_content_prompt{system, prompt}, $type, $mode, $context, $optionsThe final prompt
siteryn_ai_product_content_generated (action)$result, $product, $modeAfter a product generation (also in bulk)
siteryn_ai_product_content_generate_response$data, $result, $productThe panel's JSON response

Applying

HookArgumentsUse
siteryn_ai_product_content_before_apply$value, $type, $productChange a value before it's saved
siteryn_ai_product_content_apply_{$type}$default, $value, $productSave a custom type; return non-WP_Error
siteryn_ai_product_content_applied (action)$product, $type, $valueAfter saving
In the panel, Use for the title, descriptions, excerpt (and tags when the tag box is shown) only fills the editor; your Update click saves them, so these hooks don't fire. They run for attributes, tags saved directly, custom and Pro types, Pro approvals and restores, and ProductWriter::apply().

Panel & settings

HookUse
siteryn_ai_product_content_panel_before_items · _panel_after_items (actions, $product_id)Add controls to the panel
siteryn_ai_product_content_settings_get_allFree settings at runtime
siteryn_ai_product_content_settings_sections · _settings_fields · _render_field_{type} · _sanitize_field_{type}Extend the settings screen
…_settings_save_redirect · …_settings_reset_actions · …_settings_nav_visible · …_settings_nav_badge · …_settings_nav_icon · …_settings_nav_sublabel · …_settings_description · …_status_summary_cards · …_admin_iconsSettings screen details
siteryn_ai_product_content_settings_main_after · _settings_sidebar (actions, $section)Add content below the General tab's form or to its sidebar
siteryn_ai_product_content_loaded · _upgrade · _deactivate (actions)Lifecycle

Pro

HookUse
siteryn_ai_product_content_pro_loaded · _pro_features_loaded · _pro_upgrade · _pro_activated · _pro_deactivateLifecycle
siteryn_ai_product_content_pro_job_completed (action, $job)A bulk job finished (counts in queued, skipped, failed)
siteryn_ai_product_content_pro_quality_report$report, $type, $value, $context: change the quality score (score, passed, issues)
siteryn_ai_product_content_pro_seo_plugins$plugins (id ⇒ constant, title, description, keyword, label): add an SEO plugin target; see the example
siteryn_ai_product_content_pro_language_catalog · _pro_available_languages$languages (locale ⇒ name): the languages offered in Pro Settings · those offered when generating
siteryn_ai_product_content_pro_license_activated ($outcome) · _deactivated ($done) · _pro_admin_config ($config)License · admin script config (never add secrets)

Examples

A brand rule and a prompt addition

add_filter( 'siteryn_ai_product_content_system_rules', function ( $rules, $type, $options ) {
	$rules['brand'] = 'Always refer to the store as "Acme".';
	return $rules;
}, 10, 3 );
add_filter( 'siteryn_ai_product_content_prompt', function ( $parts, $type, $mode, $context, $options ) {
	if ( 'description' === $type ) {
		$parts['prompt'] .= "\n\nMention care instructions only if given.";
	}
	return $parts;
}, 10, 5 );

Never send the SKU

add_filter( 'siteryn_ai_product_content_product_context', function ( $context, $product, $allowed ) {
	unset( $context['sku'] );
	return $context;
}, 10, 3 );

A panel checkbox that changes the prompt

add_action( 'siteryn_ai_product_content_panel_before_items', function ( $product_id ) {
	echo '<label><input type="checkbox" data-siteryn-aipc-option="eco" value="1"> Eco angle</label>';
} );
add_filter( 'siteryn_ai_product_content_generation_options', function ( $clean, $raw, $type ) {
	if ( ! empty( $raw['eco'] ) ) {
		$clean['eco'] = true;
	}
	return $clean;
}, 10, 3 );
add_filter( 'siteryn_ai_product_content_system_rules', function ( $rules, $type, $options ) {
	if ( ! empty( $options['eco'] ) ) {
		$rules['eco'] = 'Highlight sustainability facts present in the data.';
	}
	return $rules;
}, 10, 3 );

Fix wording and log saves

add_filter( 'siteryn_ai_product_content_before_apply', function ( $value, $type, $product ) {
	return 'title' === $type ? str_replace( 'Colour', 'Color', $value ) : $value;
}, 10, 3 );
add_action( 'siteryn_ai_product_content_applied', function ( $product, $type, $value ) {
	wc_get_logger()->info( "AI {$type} applied to #{$product->get_id()}", array( 'source' => 'my-audit' ) );
}, 10, 3 );

A self-hosted model on your network

add_filter( 'siteryn_ai_product_content_allow_private_endpoint', function ( $allow, $url ) {
	return 0 === strpos( $url, 'https://10.0.0.5:8443/' );
}, 10, 2 );

Save Pro meta to another SEO plugin Pro

add_filter( 'siteryn_ai_product_content_pro_seo_plugins', function ( $plugins ) {
	$plugins['my_seo'] = array(
		'constant'    => 'MY_SEO_VERSION',   // detected when this constant is defined
		'title'       => '_my_seo_title',    // product meta keys
		'description' => '_my_seo_description',
		'keyword'     => '_my_seo_focus_keyword',
		'label'       => 'My SEO',
	);
	return $plugins;
} );

The first active plugin in the list wins, so a plugin added here is used only when Yoast SEO, Rank Math and SEOPress aren't active.

React to a suggestion in JavaScript

document.addEventListener( 'siteryn-aipc:suggestion', function ( e ) {
	console.log( e.detail.type, e.detail.productId, e.detail.data.value );
} );