Image Generator 1.9.0 has 3 actions and 37 filters, read directly from its source code on Nov 19, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Image Generator fires an action
add_action( 'aimg_enqueue_modal', function( $arg1 ) {
// Your code runs here.
}, 10, 1 );
// Change a value Image Generator is about to use
add_filter( 'aimg_use_action_scheduler', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
/** * Fires after the image modal script is enqueued, e.g. to add modal tabs with * the JS filter `aimgModal.tabs` from a script that depends on wp-hooks. */ do_action( 'aimg_enqueue_modal', 'aimg-editor' ); -
/** * Filter whether background jobs use Action Scheduler when it is available. */ apply_filters( 'aimg_use_action_scheduler', true ); -
/** * Filters the available admin notices. */ apply_filters( 'aimg_admin_notices', $notices ); -
/** * Filter how many AI images a user may generate per hour. 0 means no limit. */ apply_filters( 'aimg_ai_hourly_limit', absint( aimg_get_settings( 'ai_hourly_limit', 20 ) ), $user_id ); -
/** * Filter the attachment used as a post author's avatar in templates. */ apply_filters( 'aimg_author_avatar_attachment', $id, (int) $post->post_author ); -
/** * Filter the post statuses that get an AI featured image automatically. */ apply_filters( 'aimg_auto_generate_statuses', array( 'publish', 'future', 'private' ), $post_id ); -
/** * Filter whether a user may generate images from an AI prompt. */ apply_filters( 'aimg_can_generate_from_prompt', user_can( $user_id, $cap ), $user_id ); -
/** * Fires after the Template Studio is enqueued, to enqueue scripts that add * layer types with the JS filter `aimg.studio.layerTypes`. Make them depend on * `aimg-template-studio`. */ do_action( 'aimg_enqueue_template_studio' ); -
/** * Filter the fonts text layers can use. */ apply_filters( 'aimg_fonts', $fonts ); -
/** * Filter the endpoint used to generate images from a prompt. */ apply_filters( 'aimg_generate_endpoint', 'https://api.openai.com/v1/images/generations', $prompt ); -
/** * Filter the request body sent to the image generation API. */ apply_filters( 'aimg_generate_request_body', $this->get_request_body( $prompt, $args ), $prompt ); -
/** * Filter the timeout, in seconds, for the image generation request. */ apply_filters( 'aimg_generate_timeout', 180, $model, $args['quality'] ); -
/** * Fires after an image generated by the plugin has been added to the Media * Library. */ do_action( 'aimg_generated_image', $attachment_id, $provenance ); -
/** * Filter the generation methods offered for automatic featured images. */ apply_filters( 'aimg_generation_methods', $methods ); -
/** * Filter whether a queued job is started right away with a request to this * site. */ apply_filters( 'aimg_kick_queue', true, $post_id ); -
/** * Filter the capability needed to create, edit and delete image templates. */ apply_filters( 'aimg_manage_templates_capability', 'manage_options' ); -
/** * Filter the merge tags offered in the Template Studio. Give them values with * `aimg_merge_tags`. */ apply_filters( 'aimg_merge_tag_names', $names ); -
/** * Filter the merge tag values used in template text. */ apply_filters( 'aimg_merge_tags', $values, $post ? $post->ID : 0 ); -
/** * Filters how often the stale notice state is cleaned up. */ apply_filters( 'aimg_notices_cleanup_interval', 30 * DAY_IN_SECONDS ); -
/** * Filter the prompt built for a post. */ apply_filters( 'aimg_post_prompt', $prompt, $post_id ); -
/** * Short-circuit generating an image for a post, e.g. for a custom method. */ apply_filters( 'aimg_pre_generate_for_post', null, $post_id, $method ); -
/** * Filter the AI image providers. */ apply_filters( 'aimg_providers', array( $openai->get_id() => $openai ) ); -
/** * Filter the sanitized plugin settings, e.g. to keep settings an add-on adds * to the form. */ apply_filters( 'aimg_sanitize_settings', $sanitized_settings, (array) $settings ); -
/** * Filter the search terms for a post's stock photo. */ apply_filters( 'aimg_stock_keywords', $query, $post_id ); -
/** * Filter the largest stock photo file that is imported, in bytes. */ apply_filters( 'aimg_stock_max_bytes', 25 * MB_IN_BYTES ); -
/** * Filter the stock photo providers. */ apply_filters( 'aimg_stock_providers', $providers ); -
/** * Filter the words left out of stock photo searches. */ apply_filters( 'aimg_stock_stop_words', $words ); -
/** * Filter the sample values the Template Studio shows for merge tags. */ apply_filters( 'aimg_studio_sample_tags', $samples ); -
/** * Filter the AI style presets. */ apply_filters( 'aimg_style_presets', $styles ); -
/** * Filter a v2 template document before it is rendered. */ apply_filters( 'aimg_template_document', Templates\Repository::get_document( $template_id ), $template_id, $title ); -
/** * Filter the template used for a post's automatic featured image. */ apply_filters( 'aimg_template_for_post', $template_id, $post_id ); -
/** * Filter the template layer types. Register the same type in the Studio with * the JS filter `aimg.studio.layerTypes`. Layers of a type that is no longer * registered are kept in their templates but not drawn. */ apply_filters( 'aimg_template_layers', $types ); -
/** * Filter the arguments used to render an image from a template. */ apply_filters( 'aimg_template_render_args', $args, $template_id ); -
/** * Filter the starter designs offered for new templates. */ apply_filters( 'aimg_template_starters', $out ); -
/** * Filter the query arguments for the list table. */ apply_filters( 'aimg_templates_table_query_args', $args ); -
/** * Filter the application name sent to Unsplash in credit links (utm_source). */ apply_filters( 'aimg_unsplash_app_name', 'image_generator' ); -
/** * This filter is documented in wp-includes/class-wp-http-streams.php */ apply_filters( 'https_local_ssl_verify', false ); -
apply_filters( 'aimg_set_screen_options', array( 'aimg_img_templates_per_page', ) ); -
apply_filters( 'aimg_template_post_type_args', $args ); -
apply_filters( 'aimg_template_post_type_labels', $labels );
Generated from Image Generator's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: