AI Image SEO Optimizer

Filters Reference

Complete reference for all apply_filters() hooks in AI Image SEO Optimizer. Modify AI optimization, models, image queries, prompts, UI, and more.

schedule 1 min read update Updated 1 month ago local_offer Version 1.0.0

Complete reference of all filter hooks available in AI Image SEO Optimizer. Use filter hooks to modify values returned by the plugin — AI model configuration, image queries, prompts, UI labels, and more.

info

How to use filter hooks

Add your callback with add_filter() in your theme’s functions.php or a custom plugin. Your callback receives a value as the first argument and must return a modified (or unmodified) value.

Optimization Lifecycle

Filter Since 1.0.0

infyp_after_ai_optimization

Allow extensions to generate additional fields (e.g. caption, description)

Parameters

Name Type Description
$new_data mixed Parameter $new_data
$image_id mixed Parameter $image_id
$model_name mixed Parameter $model_name

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_after_ai_optimization', function( $new_data, $image_id, $model_name ) {n    // Modify and return $new_datan    return $new_data;n}, 10, 3 );
Filter Since 1.0.0

infyp_allowed_optimize_field_types

error_log('[Single Field Handler] Image ID: ' . $image_id . ', Field type: ' . $field_type); Validate field type – extensible via filter for add-ons

Example

add_filter( 'infyp_allowed_optimize_field_types', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_generated_keywords

Filter AI-generated keywords before saving. @since 1.0.0 @param array $keywords The generated keywords. @param int $image_id The attachment ID.

Parameters

Name Type Description
$sanitized_keywords mixed Parameter $sanitized_keywords
$image_id mixed Parameter $image_id

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_generated_keywords', function( $sanitized_keywords, $image_id ) {n    // Modify and return $sanitized_keywordsn    return $sanitized_keywords;n}, 10, 2 );
Filter Since 1.0.0

infyp_max_keywords

Filter the maximum number of keywords allowed per image. @since 1.0.0 @param int $max_keywords Default maximum keywords. Default 3.

Example

add_filter( 'infyp_max_keywords', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_optimize_extended_field

Filters the optimize extended field.

Parameters

Name Type Description
$image_id mixed Parameter $image_id
$field_type mixed Parameter $field_type
$existing_keywords mixed Parameter $existing_keywords

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_optimize_extended_field', function( $image_id, $field_type, $existing_keywords ) {n    // Modify and return $image_idn    return $image_id;n}, 10, 3 );
Filter Since 1.0.0

infyp_optimize_field_result

@since 1.0.0 @param array|null $result Default null (use built-in optimization). @param int $image_id The attachment ID. @param string $field_type The field being optimized. @param array|null $existing_keywords Keywords for context. @param string $custom_prompt Custom prompt text.

Parameters

Name Type Description
$image_id mixed Parameter $image_id
$field_type mixed Parameter $field_type
$existing_keywords mixed Parameter $existing_keywords
$custom_prompt mixed Parameter $custom_prompt

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_optimize_field_result', function( $image_id, $field_type, $existing_keywords, $custom_prompt ) {n    // Modify and return $image_idn    return $image_id;n}, 10, 4 );
Filter Since 1.0.0

infyp_process_ai_result_data

@since 1.0.0 @param array $new_data Processed field data. @param array $result Raw AI result. @param int $image_id Image attachment ID.

Parameters

Name Type Description
$new_data mixed Parameter $new_data
$result mixed Parameter $result
$image_id mixed Parameter $image_id

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_process_ai_result_data', function( $new_data, $result, $image_id ) {n    // Modify and return $new_datan    return $new_data;n}, 10, 3 );
Filter Since 1.0.0

infyp_run_optimization

@since 1.1.0 @param array|WP_Error $result The optimization result. @param int $image_id The attachment ID. @param array|null $existing_keywords The existing keywords. @param string $custom_prompt The custom prompt.

Parameters

Name Type Description
$result mixed Parameter $result
$image_id mixed Parameter $image_id
$existing_keywords mixed Parameter $existing_keywords
$custom_prompt mixed Parameter $custom_prompt

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_run_optimization', function( $result, $image_id, $existing_keywords, $custom_prompt ) {n    // Modify and return $resultn    return $result;n}, 10, 4 );
Filter Since 1.0.0

infyp_run_single_field_optimization

@since 1.1.0 @param array|WP_Error $result The optimization result. @param int $image_id The attachment ID. @param string $field_type The field type. @param array $options The options passed.

Parameters

Name Type Description
$result mixed Parameter $result
$image_id mixed Parameter $image_id
$field_type mixed Parameter $field_type
$options mixed Parameter $options

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_run_single_field_optimization', function( $result, $image_id, $field_type, $options ) {n    // Modify and return $resultn    return $result;n}, 10, 4 );
Filter Since 1.0.0

infyp_save_extended_field_result

@since 1.0.0 @param array|null $save_result Null to indicate not handled. Array with 'new_value' and optional 'changelog_data' keys to indicate success. @param int $image_id The attachment ID. @param string $field_type The custom field type being optimized. @param array $result The AI optimization result array. @param string $current_value The current field value.

Parameters

Name Type Description
$image_id mixed Parameter $image_id
$field_type mixed Parameter $field_type
$result mixed Parameter $result
$current_value mixed Parameter $current_value

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_save_extended_field_result', function( $image_id, $field_type, $result, $current_value ) {n    // Modify and return $image_idn    return $image_id;n}, 10, 4 );

AI Providers & Prompts

Filter Since 1.0.0

infyp_ai_models

@since 1.0.0 Filter to allow extensions to add additional AI model categories. */

Parameters

Name Type Description
$ai_models mixed Parameter $ai_models

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_ai_models', function( $ai_models ) {n    // Modify and return $ai_modelsn    return $ai_models;n} );
Filter Since 1.0.0

infyp_ai_response_possible_keys

Fallback: Try to find any valid field in the response Sometimes the API might return a slightly different key

Example

add_filter( 'infyp_ai_response_possible_keys', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_api_retry_config

Filters the api retry config.

Example

add_filter( 'infyp_api_retry_config', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_calculate_api_cost

@since 1.0.0 @param float $cost Calculated cost in USD. @param string $model The AI model identifier. @param int $tokens Approximate token count for the call. @param float $base_cost Base cost per million tokens used in calculation.

Parameters

Name Type Description
$cost mixed Parameter $cost
$model mixed Parameter $model
$tokens mixed Parameter $tokens
$base_cost mixed Parameter $base_cost

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_calculate_api_cost', function( $cost, $model, $tokens, $base_cost ) {n    // Modify and return $costn    return $cost;n}, 10, 4 );
Filter Since 1.0.0

infyp_extended_field_prompt

Allow extensions to provide custom prompts for extended field types.

Parameters

Name Type Description
$model mixed Parameter $model
$field_type mixed Parameter $field_type
$language mixed Parameter $language
$prompt_addon mixed Parameter $prompt_addon
$existing_keywords mixed Parameter $existing_keywords

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_extended_field_prompt', function( $model, $field_type, $language, $prompt_addon, $existing_keywords ) {n    // Modify and return $modeln    return $model;n}, 10, 5 );
Filter Since 1.0.0

infyp_get_provider_for_model

Filter the provider for a given model. @since 1.1.0 @param string|null $provider The provider slug. @param string $model The model identifier.

Parameters

Name Type Description
$provider mixed Parameter $provider
$model mixed Parameter $model

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_get_provider_for_model', function( $provider, $model ) {n    // Modify and return $providern    return $provider;n}, 10, 2 );
Filter Since 1.0.0

infyp_image_context

Extensions can use this to inject contextual data, custom post type context, etc. @since 1.0.0 @param string $prompt_addon Current prompt addon text @param int $image_id The image attachment ID being optimized @param string $context_type The optimization context (field type: 'filename', 'alt_text', 'title', etc.)

Parameters

Name Type Description
$prompt_addon mixed Parameter $prompt_addon
$image_id mixed Parameter $image_id
$field_type mixed Parameter $field_type

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_image_context', function( $prompt_addon, $image_id, $field_type ) {n    // Modify and return $prompt_addonn    return $prompt_addon;n}, 10, 3 );
Filter Since 1.0.0

infyp_keywords_prompt

@since 1.0.0 @param string $prompt The constructed prompt. @param string $model AI model identifier. @param string $language Target language. @param string $prompt_addon Custom instructions included.

Parameters

Name Type Description
$prompt mixed Parameter $prompt
$model mixed Parameter $model
$language mixed Parameter $language
$prompt_addon mixed Parameter $prompt_addon

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_keywords_prompt', function( $prompt, $model, $language, $prompt_addon ) {n    // Modify and return $promptn    return $prompt;n}, 10, 4 );
Filter Since 1.0.0

infyp_max_prompt_length

Limit prompt addon length – use mb_strlen for UTF-8 support

Example

add_filter( 'infyp_max_prompt_length', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_model_labels

Register additional AI model labels for the admin UI. @since 1.0.0 @param array $model_labels Model ID => display label.

Parameters

Name Type Description
$model_labels mixed Parameter $model_labels

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_model_labels', function( $model_labels ) {n    // Modify and return $model_labelsn    return $model_labels;n} );
Filter Since 1.0.0

infyp_prompt_addon

Filter hook for prompt addon customization

Parameters

Name Type Description
$prompt_addon mixed Parameter $prompt_addon
$image_id mixed Parameter $image_id
$field_type mixed Parameter $field_type

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_prompt_addon', function( $prompt_addon, $image_id, $field_type ) {n    // Modify and return $prompt_addonn    return $prompt_addon;n}, 10, 3 );
Filter Since 1.0.0

infyp_prompt_format

Override the resolved prompt format for any model. @since 1.0.0 @param string $format Resolved format ('json', 'json_plain', 'tool_use'). @param string $model AI model identifier. @param string $provider Provider slug.

Parameters

Name Type Description
$format mixed Parameter $format
$model mixed Parameter $model
$config mixed Parameter $config

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_prompt_format', function( $format, $model, $config ) {n    // Modify and return $formatn    return $format;n}, 10, 3 );
Filter Since 1.0.0

infyp_prompt_sections

@since 1.0.0 @param array $sections Associative array of prompt sections. @param string $field_type Field being optimized. @param string $model AI model identifier. @param string $language Target language.

Parameters

Name Type Description
$sections mixed Parameter $sections
$field_type mixed Parameter $field_type
$model mixed Parameter $model
$language mixed Parameter $language

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_prompt_sections', function( $sections, $field_type, $model, $language ) {n    // Modify and return $sectionsn    return $sections;n}, 10, 4 );
Filter Since 1.0.0

infyp_provider_for_model

Registry both fail to resolve the provider. Extensions can use this to map custom model names to their provider slug. @since 1.0.0 @param string|null $provider Resolved provider slug (null at this point). @param string $model The model identifier being resolved.

Parameters

Name Type Description
$model mixed Parameter $model

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_provider_for_model', function( $model ) {n    // Modify and return $modeln    return $model;n} );
Filter Since 1.0.0

infyp_register_ai_providers

@example add_filter( 'infyp_register_ai_providers', function( $providers ) { $providers['custom_ai'] = new My_Custom_AI_Provider(); return $providers; } );

Parameters

Name Type Description
$this mixed Parameter $this

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_register_ai_providers', function( $this ) {n    // Modify and return $thisn    return $this;n} );
Filter Since 1.0.0

infyp_simplified_prompt

@since 1.0.0 @param string $prompt The simplified prompt. @param string $model The AI model identifier. @param string $provider The resolved provider slug. @param string $language The target language.

Parameters

Name Type Description
$prompt mixed Parameter $prompt
$model mixed Parameter $model
$provider mixed Parameter $provider
$language mixed Parameter $language

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_simplified_prompt', function( $prompt, $model, $provider, $language ) {n    // Modify and return $promptn    return $prompt;n}, 10, 4 );
Filter Since 1.0.0

infyp_single_field_prompt

@param string $prompt The generated prompt. @param string $model AI model identifier. @param string $field_type The field being optimized. @param string $language Target language. @param string $prompt_addon Custom user instructions. @param array|null $existing_keywords Keywords for context.

Parameters

Name Type Description
$prompt mixed Parameter $prompt
$model mixed Parameter $model
$field_type mixed Parameter $field_type
$language mixed Parameter $language
$prompt_addon mixed Parameter $prompt_addon
$existing_keywords mixed Parameter $existing_keywords

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_single_field_prompt', function( $prompt, $model, $field_type, $language, $prompt_addon, $existing_keywords ) {n    // Modify and return $promptn    return $prompt;n}, 10, 6 );

Settings & Configuration

Filter Since 1.0.0

infyp_allowed_api_key_providers

Extensions registering custom AI providers via `infyp_register_ai_providers` should also hook here to allow their API keys to be saved through the settings. @since 1.0.0 @param array $providers Provider slug strings (e.g. 'openai', 'google', 'anthropic').

Example

add_filter( 'infyp_allowed_api_key_providers', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_allowed_edit_fields

Validate field – extensible via filter for add-ons

Example

add_filter( 'infyp_allowed_edit_fields', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_extended_field_types

Allow extensions to handle custom field types

Example

add_filter( 'infyp_extended_field_types', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_get_active_model

Filter the active AI model. @since 1.1.0 @param string $model The model identifier.

Parameters

Name Type Description
$model mixed Parameter $model

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_get_active_model', function( $model ) {n    // Modify and return $modeln    return $model;n} );
Filter Since 1.0.0

infyp_get_api_key

Filter the API key for a provider. @since 1.1.0 @param string|null $key The API key. @param string $provider The provider slug.

Parameters

Name Type Description
$key mixed Parameter $key
$provider mixed Parameter $provider

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_get_api_key', function( $key, $provider ) {n    // Modify and return $keyn    return $key;n}, 10, 2 );
Filter Since 1.0.0

infyp_get_language

Filter the AI prompt language. @since 1.1.0 @param string $lang The language name.

Parameters

Name Type Description
$lang mixed Parameter $lang

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_get_language', function( $lang ) {n    // Modify and return $langn    return $lang;n} );
Filter Since 1.0.0

infyp_get_setting

@since 1.1.0 @param mixed $value The setting value. @param string $key The setting key. @param mixed $default The default value.

Parameters

Name Type Description
$value mixed Parameter $value
$key mixed Parameter $key
$default mixed Parameter $default

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_get_setting', function( $value, $key, $default ) {n    // Modify and return $valuen    return $value;n}, 10, 3 );
Filter Since 1.0.0

infyp_supported_mime_types

Filters the supported mime types.

Example

add_filter( 'infyp_supported_mime_types', function( $value ) {n    // Modify and return $valuen    return $value;n} );

Image Data & Queries

Filter Since 1.0.0

infyp_changelog_entry

Filter a changelog entry before saving. Return false to skip saving the entry. @since 1.0.0 @param array $entry The changelog entry data.

Parameters

Name Type Description
$entry mixed Parameter $entry

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_changelog_entry', function( $entry ) {n    // Modify and return $entryn    return $entry;n} );
Filter Since 1.0.0

infyp_find_image_usage

Filter the image usage results. @since 1.1.0 @param array $usage The usage data. @param int $image_id The attachment ID.

Parameters

Name Type Description
$usage mixed Parameter $usage
$image_id mixed Parameter $image_id

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_find_image_usage', function( $usage, $image_id ) {n    // Modify and return $usagen    return $usage;n}, 10, 2 );
Filter Since 1.0.0

infyp_get_image_base64

Filter the base64 image data. @since 1.1.0 @param string|WP_Error $base64 The base64 data. @param int $image_id The attachment ID.

Parameters

Name Type Description
$base64 mixed Parameter $base64
$image_id mixed Parameter $image_id

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_get_image_base64', function( $base64, $image_id ) {n    // Modify and return $base64n    return $base64;n}, 10, 2 );
Filter Since 1.0.0

infyp_get_image_count

Filter the image count. @since 1.1.0 @param int $count The image count. @param array $args The query arguments used.

Parameters

Name Type Description
$count mixed Parameter $count
$args mixed Parameter $args

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_get_image_count', function( $count, $args ) {n    // Modify and return $countn    return $count;n}, 10, 2 );
Filter Since 1.0.0

infyp_get_image_ids

Filter the returned image IDs. @since 1.1.0 @param array $ids The image IDs. @param array $args The query arguments used.

Parameters

Name Type Description
$ids mixed Parameter $ids
$args mixed Parameter $args

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_get_image_ids', function( $ids, $args ) {n    // Modify and return $idsn    return $ids;n}, 10, 2 );
Filter Since 1.0.0

infyp_image_data_response

Filter image data before sending to the frontend. @since 1.0.0 @param array $data The image data array. @param int $image_id The attachment ID.

Parameters

Name Type Description
$data mixed Parameter $data
$image_id mixed Parameter $image_id

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_image_data_response', function( $data, $image_id ) {n    // Modify and return $datan    return $data;n}, 10, 2 );
Filter Since 1.0.0

infyp_image_query_args

Filter the image query arguments. @since 1.1.0 @param array $args The query arguments.

Parameters

Name Type Description
$args mixed Parameter $args

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_image_query_args', function( $args ) {n    // Modify and return $argsn    return $args;n} );
Filter Since 1.0.0

infyp_image_query_where_conditions

SECURITY: All values MUST use $wpdb->prepare() with placeholders. Raw strings are injected directly into the SQL query. @since 1.0.0 @param array $where_conditions Array of prepared SQL WHERE condition strings. @param array $filter_types Active filter types.

Parameters

Name Type Description
$where_conditions mixed Parameter $where_conditions
$filter_types mixed Parameter $filter_types

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_image_query_where_conditions', function( $where_conditions, $filter_types ) {n    // Modify and return $where_conditionsn    return $where_conditions;n}, 10, 2 );
Filter Since 1.0.0

infyp_image_usage_html

Filter the image usage HTML before sending to frontend. @since 1.0.0 @param string $html The usage HTML. @param int $image_id The attachment ID. @param array $usage The raw usage data array.

Parameters

Name Type Description
$html mixed Parameter $html
$image_id mixed Parameter $image_id
$usage mixed Parameter $usage

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_image_usage_html', function( $html, $image_id, $usage ) {n    // Modify and return $htmln    return $html;n}, 10, 3 );
Filter Since 1.0.0

infyp_image_usage_post_ids

Allow extensions to find additional post IDs where this image is used (e.g. WooCommerce product galleries)

Parameters

Name Type Description
$image_id mixed Parameter $image_id
$image_url mixed Parameter $image_url

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_image_usage_post_ids', function( $image_id, $image_url ) {n    // Modify and return $image_idn    return $image_id;n}, 10, 2 );
Filter Since 1.0.0

infyp_image_usage_taxonomy

Allow extensions to add taxonomy-based usage (e.g. WooCommerce product categories)

Parameters

Name Type Description
$image_id mixed Parameter $image_id
$image_url mixed Parameter $image_url
$metadata mixed Parameter $metadata

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_image_usage_taxonomy', function( $image_id, $image_url, $metadata ) {n    // Modify and return $image_idn    return $image_id;n}, 10, 3 );
Filter Since 1.0.0

infyp_populate_lookup_table

Allow extensions to populate additional image relationships (e.g. WooCommerce galleries, taxonomy thumbnails)

Parameters

Name Type Description
$stats mixed Parameter $stats
$table_name mixed Parameter $table_name
$wpdb mixed Parameter $wpdb

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_populate_lookup_table', function( $stats, $table_name, $wpdb ) {n    // Modify and return $statsn    return $stats;n}, 10, 3 );
Filter Since 1.0.0

infyp_search_index_combined_parts

Extensions can add custom field data (e.g., caption, description) for search. @since 1.0.0 @param array $combined_parts Array of text strings to concatenate. @param int $image_id The attachment ID. @param object $attachment The WP_Post attachment object.

Parameters

Name Type Description
$combined_parts mixed Parameter $combined_parts
$image_id mixed Parameter $image_id
$attachment mixed Parameter $attachment

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_search_index_combined_parts', function( $combined_parts, $image_id, $attachment ) {n    // Modify and return $combined_partsn    return $combined_parts;n}, 10, 3 );
Filter Since 1.0.0

infyp_validate_image_id

Filter whether an image ID is valid. @since 1.1.0 @param bool $is_valid Whether the image is valid. @param int $image_id The attachment ID.

Parameters

Name Type Description
$is_valid mixed Parameter $is_valid
$image_id mixed Parameter $image_id

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_validate_image_id', function( $is_valid, $image_id ) {n    // Modify and return $is_validn    return $is_valid;n}, 10, 2 );

File Renaming & Redirects

Filter Since 1.0.0

infyp_filename_before_apply

Filter the filename before applying the rename. @since 1.0.0 @param string $filename The proposed filename (without extension). @param int $image_id The attachment ID. @param string $old_name The current filename.

Parameters

Name Type Description
$new_data mixed Parameter $new_data
$image_id mixed Parameter $image_id
$old_data mixed Parameter $old_data

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_filename_before_apply', function( $new_data, $image_id, $old_data ) {n    // Modify and return $new_datan    return $new_data;n}, 10, 3 );
Filter Since 1.0.0

infyp_pre_file_rename

@since 1.0.0 @param bool $proceed Whether to proceed. Default true. @param int $post_id The attachment ID. @param string $new_filename The proposed new filename (without extension). @param string $old_path The current file path.

Parameters

Name Type Description
$post_id mixed Parameter $post_id
$new_filename_sans_ext mixed Parameter $new_filename_sans_ext
$file_path mixed Parameter $file_path

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_pre_file_rename', function( $post_id, $new_filename_sans_ext, $file_path ) {n    // Modify and return $post_idn    return $post_id;n}, 10, 3 );

Table & UI

Filter Since 1.0.0

infyp_admin_header_badge

Filter to allow extensions to add a badge to admin page titles. @since 1.0.0 @param string $badge_html The badge HTML.

Example

add_filter( 'infyp_admin_header_badge', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_admin_i18n_strings

Filters the admin i18n strings.

Example

add_filter( 'infyp_admin_i18n_strings', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_admin_localize_data

Filters the admin localize data.

Parameters

Name Type Description
$localize_data mixed Parameter $localize_data

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_admin_localize_data', function( $localize_data ) {n    // Modify and return $localize_datan    return $localize_data;n} );
Filter Since 1.0.0

infyp_admin_menu_capability

Allow extensions to change the required capability for all plugin pages.

Example

add_filter( 'infyp_admin_menu_capability', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_edit_field_log_name

Filters the edit field log name.

Parameters

Name Type Description
$field mixed Parameter $field
$field mixed Parameter $field

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_edit_field_log_name', function( $field, $field ) {n    // Modify and return $fieldn    return $field;n}, 10, 2 );
Filter Since 1.0.0

infyp_edit_field_old_value

Filters the edit field old value.

Parameters

Name Type Description
$image_id mixed Parameter $image_id
$field mixed Parameter $field

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_edit_field_old_value', function( $image_id, $field ) {n    // Modify and return $image_idn    return $image_id;n}, 10, 2 );
Filter Since 1.0.0

infyp_handle_edit_field

@since 1.0.0 @param bool $handled Whether the field was handled. Default false. @param int $image_id The image attachment ID. @param string $field The field name being edited. @param string $value The new field value.

Parameters

Name Type Description
$image_id mixed Parameter $image_id
$field mixed Parameter $field
$value mixed Parameter $value

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_handle_edit_field', function( $image_id, $field, $value ) {n    // Modify and return $image_idn    return $image_id;n}, 10, 3 );
Filter Since 1.0.0

infyp_image_table_columns_before

Allow extensions to add checkbox column via filter

Parameters

Name Type Description
$columns mixed Parameter $columns

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_image_table_columns_before', function( $columns ) {n    // Modify and return $columnsn    return $columns;n} );
Filter Since 1.0.0

infyp_post_type_filter_options

Filter the post type filter options displayed in the list table UI. @since 1.0.0 @param array $filter_options Current filter options array.

Parameters

Name Type Description
$filter_options mixed Parameter $filter_options

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_post_type_filter_options', function( $filter_options ) {n    // Modify and return $filter_optionsn    return $filter_options;n} );
Filter Since 1.0.0

infyp_provider_display_names

Used across the API Usage list table, usage page view, and chart labels. Extensions registering custom providers should hook here to provide a proper display name for their provider slug. @since 1.0.0 @param array $names Associative array of provider slug => display name.

Parameters

Name Type Description
$names mixed Parameter $names

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_provider_display_names', function( $names ) {n    // Modify and return $namesn    return $names;n} );
Filter Since 1.0.0

infyp_reset_banner_meta_keys

Filter the list of user meta keys to reset when resetting all banners. Extensions can add their own dismissed notice meta keys here. @since 1.0.0 @param array $banner_meta_keys Array of user meta keys to delete. @param int $user_id The current user ID.

Parameters

Name Type Description
$banner_meta_keys mixed Parameter $banner_meta_keys
$user_id mixed Parameter $user_id

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_reset_banner_meta_keys', function( $banner_meta_keys, $user_id ) {n    // Modify and return $banner_meta_keysn    return $banner_meta_keys;n}, 10, 2 );
Filter Since 1.0.0

infyp_skip_prepare_items

The screen option and meta box are already set up in on_load_main_page(). Performance: Skip prepare_items() on initial load to prevent blocking The AJAX table loader will fetch data after page renders Only prepare items if explicitly requested via filter (for backward compatibility)

Example

add_filter( 'infyp_skip_prepare_items', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_table_column_

Allow extensions to handle custom columns

Parameters

Name Type Description
$column_name mixed Parameter $column_name
$item mixed Parameter $item

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_table_column_', function( $column_name, $item ) {n    // Modify and return $column_namen    return $column_name;n}, 10, 2 );
Filter Since 1.0.0

infyp_table_columns_after_title

Hook for extensions to add columns after title

Parameters

Name Type Description
$columns mixed Parameter $columns

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_table_columns_after_title', function( $columns ) {n    // Modify and return $columnsn    return $columns;n} );
Filter Since 1.0.0

infyp_usage_chart_provider_colors

Each provider key maps to an array with 'border' (line color) and 'bg' (fill color) values. Unknown providers default to gray. @since 1.0.0 @param array $colors Associative array of provider slug => color config.

Example

add_filter( 'infyp_usage_chart_provider_colors', function( $value ) {n    // Modify and return $valuen    return $value;n} );

Security & Rate Limiting

Filter Since 1.0.0

infyp_capability_map

Filters the capability map.

Parameters

Name Type Description
$capabilities mixed Parameter $capabilities

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_capability_map', function( $capabilities ) {n    // Modify and return $capabilitiesn    return $capabilities;n} );
Filter Since 1.0.0

infyp_check_capability

Filter the capability check. @since 1.1.0 @param bool $has_cap Whether the user has the capability. @param string $action The action being checked.

Parameters

Name Type Description
$has_cap mixed Parameter $has_cap
$action mixed Parameter $action

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_check_capability', function( $has_cap, $action ) {n    // Modify and return $has_capn    return $has_cap;n}, 10, 2 );
Filter Since 1.0.0

infyp_max_security_events

Filters the max security events.

Example

add_filter( 'infyp_max_security_events', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_rate_limited_actions

Filters the rate limited actions.

Parameters

Name Type Description
$rate_limited_actions mixed Parameter $rate_limited_actions

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_rate_limited_actions', function( $rate_limited_actions ) {n    // Modify and return $rate_limited_actionsn    return $rate_limited_actions;n} );
Filter Since 1.0.0

infyp_rate_limits

Allow extensions to register additional rate limits

Parameters

Name Type Description
$this mixed Parameter $this

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_rate_limits', function( $this ) {n    // Modify and return $thisn    return $this;n} );

Page Builders

Filter Since 1.0.0

infyp_detect_page_builder

@since 1.0.0 @param string $builder_name Current builder name (empty if not yet detected). @param int $post_id The post ID being checked. @param string $image_url The image URL being searched for. @param int $image_id The image attachment ID.

Parameters

Name Type Description
$post_id mixed Parameter $post_id
$image_url mixed Parameter $image_url
$image_id mixed Parameter $image_id

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_detect_page_builder', function( $post_id, $image_url, $image_id ) {n    // Modify and return $post_idn    return $post_id;n}, 10, 3 );
Filter Since 1.0.0

infyp_pagebuilder_adapter_info

@param array $info Adapter information array with keys: – name: Human-readable adapter name – is_active: Whether the adapter is active – stats: Processing statistics @return array Modified adapter information

Parameters

Name Type Description
$info mixed Parameter $info

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_pagebuilder_adapter_info', function( $info ) {n    // Modify and return $infon    return $info;n} );
Filter Since 1.0.0

infyp_register_pagebuilder_adapters

$divi_adapter = new My_Divi_Adapter(); if ($divi_adapter->is_active()) { $adapters['divi'] = $divi_adapter; } return $adapters; }, 10, 1);

Parameters

Name Type Description
$this mixed Parameter $this

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_register_pagebuilder_adapters', function( $this ) {n    // Modify and return $thisn    return $this;n} );

Extensibility Points

Filter Since 1.0.0

infyp_allowed_post_types

Developers can modify which post types appear in the image list filter. By default, all public post types are included. @since 1.0.0 @param array $types Associative array of slug => slug.

Parameters

Name Type Description
$types mixed Parameter $types

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_allowed_post_types', function( $types ) {n    // Modify and return $typesn    return $types;n} );
Filter Since 1.0.0

infyp_post_type_fallback_conditions

Allow extensions to add extra conditions (e.g. WooCommerce gallery images)

Parameters

Name Type Description
$post_type_conditions mixed Parameter $post_type_conditions
$filter_type mixed Parameter $filter_type
$wpdb mixed Parameter $wpdb

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_post_type_fallback_conditions', function( $post_type_conditions, $filter_type, $wpdb ) {n    // Modify and return $post_type_conditionsn    return $post_type_conditions;n}, 10, 3 );
Filter Since 1.0.0

infyp_seo_score_result

Filter the final SEO score result. @since 1.0.0 @param array $result The score result array with 'percentage', 'breakdown', 'suggestions'. @param int $image_id The attachment ID.

Parameters

Name Type Description
$result mixed Parameter $result
$image_id mixed Parameter $image_id

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_seo_score_result', function( $result, $image_id ) {n    // Modify and return $resultn    return $result;n}, 10, 2 );
Filter Since 1.0.0

infyp_seo_score_thresholds

Determine status

Example

add_filter( 'infyp_seo_score_thresholds', function( $value ) {n    // Modify and return $valuen    return $value;n} );
Filter Since 1.0.0

infyp_taxonomy_filter_types

Allow extensions to handle taxonomy-based filter types (e.g. product_cat)

Parameters

Name Type Description
$filter_types mixed Parameter $filter_types

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_taxonomy_filter_types', function( $filter_types ) {n    // Modify and return $filter_typesn    return $filter_types;n} );
Filter Since 1.0.0

infyp_valid_filter_types

Allow extensions to add extra valid filter types (e.g. product_cat)

Parameters

Name Type Description
$valid_types mixed Parameter $valid_types
$allowed mixed Parameter $allowed

Returns

mixed — The filtered value.

Example

add_filter( 'infyp_valid_filter_types', function( $valid_types, $allowed ) {n    // Modify and return $valid_typesn    return $valid_types;n}, 10, 2 );
check_circle

Total: 83 filter hooks

This page documents 83 filter hooks available in the free version.

Was this article helpful?

favorite

Thanks for your feedback!