AI Content Builder icon
Page Builders & Blocks

AI Content Builder hooks reference

AI Content Builder 0.24.2 has 4 actions and 28 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.

functions.phpyour child theme
// Run your own code when AI Content Builder fires an action
add_action( 'wpaic_token_usage', function( $usage, $id, $arg3 ) {
	// Your code runs here.
}, 10, 3 );

// Change a value AI Content Builder is about to use
add_filter( 'wpaic_client_config', function( $config ) {
	// Change $config here.
	return $config;
}, 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

  • includes/Admin/AdminMenu.php line 240 · used in 3 places
    /**
     * Filters the configuration of the Designer and the block editor sidebar
     * (window.wpaicConfig).
     */
    apply_filters( 'wpaic_client_config', $config );
  • includes/Providers/AbstractProvider.php line 230 · used in 3 places
    /**
     * This filter is documented in includes/Providers/AbstractProvider.php
     */
    apply_filters( 'wpaic_provider_timeout', 180 );
  • includes/AI/DesignAgent.php line 536 · used in 2 places
    /**
     * Fires after each design turn with the tokens it used, e.g. to log or meter
     * them.
     */
    do_action( 'wpaic_token_usage', $usage, $id, (string) Settings::get( 'provider' ) );
  • includes/Media/ParallelHttp.php line 43
    /**
     * This filter is documented in wp-includes/class-wp-http.php
     */
    apply_filters( 'http_request_args', $args, $url );
  • includes/Media/ParallelHttp.php line 37
    /**
     * This filter is documented in wp-includes/class-wp-http.php
     */
    apply_filters( 'pre_http_request', false, $args, $url );
  • includes/Editor/BlockCatalog.php line 54
    /**
     * Filters the blocks the AI may use.
     */
    apply_filters( 'wpaic_block_catalog', PluginBlocks::catalog( CoreBlocks::catalog( array() ) ) );
  • includes/Editor/BlockCatalog.php line 206
    /**
     * Extra guidance for the AI about one block, e.g. where to find valid ids.
     */
    apply_filters( 'wpaic_block_hint', CoreBlocks::hint( $type ), $type );
  • includes/Admin/AdminMenu.php line 138
    /**
     * Fires before the plugin's scripts are enqueued, to register scripts that
     * extend them.
     */
    do_action( 'wpaic_enqueue_scripts', $screen );
  • includes/Media/PageImages.php line 68
    /**
     * Filters what fills image requests besides the stock photo search.
     */
    apply_filters( 'wpaic_image_filler', new GeneratedImages() );
  • includes/Media/GeneratedImages.php line 54
    /**
     * Filters the image generator: an ImageGeneratorInterface, or null for none.
     */
    apply_filters( 'wpaic_image_generator', new ImageGenerator() );
  • includes/Media/ImagePrices.php line 70
    /**
     * Image prices in US dollars by generator and model (see ImagePrices::PRICES).
     */
    apply_filters( 'wpaic_image_prices', self::PRICES );
  • includes/Media/ImageGenerator.php line 280
    /**
     * Quality of generated images (low, medium, high); higher costs more.
     */
    apply_filters( 'wpaic_image_quality', 'medium' );
  • includes/Spec/PageSpec.php line 779
    /**
     * Filters the fields a photo request can have (see
     * Media\ImageFillerInterface).
     */
    apply_filters( 'wpaic_image_request_fields', array( 'search' => array( 'max' => 120 ), 'generate' => array( 'max' => 1000 ), 'generateIfNotFound' => array( 'max' => 1000, 'requires' => 'search', ), ) );
  • includes/Media/PageImages.php line 47
    /**
     * Filters IMAGE SOURCES, what the model is told it can use for images.
     */
    apply_filters( 'wpaic_image_sources', array( 'search' => $can && '' !== StockPhotos::source() ? 'yes' : 'no', 'illustrations' => $can && StockPhotos::has_illustrations() ? 'yes' : 'no', 'generate' => $can && $generator && $generator->ready() ? ( 'always' === $generator->policy() ? 'always' : 'on request' ) : 'off', ) );
  • includes/Media/MediaUsage.php line 150
    /**
     * Fires after images were found or generated, e.g. to log or bill them.
     */
    do_action( 'wpaic_media_usage', $usage, $conversation_id, $context );
  • includes/AI/DesignAgent.php line 605
    /**
     * Filters the page settings a new page the AI builds from scratch gets.
     * Settings the page can't have are left out afterwards.
     */
    apply_filters( 'wpaic_new_page_settings', $defaults, $set, $own_layout, $post_id );
  • includes/Media/Openverse.php line 56
    /**
     * Openverse licenses to search. By default only those that need no credit on
     * the page (CC0, public domain mark).
     */
    apply_filters( 'wpaic_openverse_licenses', array( 'cc0', 'pdm' ) );
  • includes/Conversation/PageSettings.php line 145
    /**
     * Filters the page settings other plugins add.
     */
    apply_filters( 'wpaic_page_fields', array() );
  • includes/Conversation/PostTypes.php line 47
    /**
     * Filters the post types a new design can become (the Designer's "Type").
     * Types without an editor, or not viewable, are left out.
     */
    apply_filters( 'wpaic_post_types', array( 'page', 'post' ) );
  • includes/AI/PromptLibrary.php line 315
    /**
     * Filters extra sections of the designer system prompt, each a markdown
     * section starting with a "# Heading" line.
     */
    apply_filters( 'wpaic_prompt_sections', array() );
  • includes/Providers/AbstractProvider.php line 90
    /**
     * Filters the temperature sent to the model, e.g. lower for a local model that
     * needs it to answer in valid JSON.
     */
    apply_filters( 'wpaic_provider_temperature', (float) ( $this->config['temperature'] ?? 0.7 ), $this->model() );
  • includes/Providers/ProviderRegistry.php line 177
    /**
     * Filters available AI providers. Add-ons can register new providers here.
     */
    apply_filters( 'wpaic_providers', $definitions );
  • includes/Admin/AdminMenu.php line 145
    /**
     * Filters the scripts that load before the plugin's own (registered handles).
     */
    apply_filters( 'wpaic_script_dependencies', array(), $screen );
  • includes/Settings/Settings.php line 115
    /**
     * Filters the default settings, e.g. to add a plugin's own settings.
     */
    apply_filters( 'wpaic_settings_defaults', $defaults );
  • includes/Settings/Settings.php line 373
    /**
     * Filters the settings sent to the admin UI, e.g. to add a plugin's own. Never
     * include secrets.
     */
    apply_filters( 'wpaic_settings_for_client', $out, $all );
  • includes/Settings/Settings.php line 499
    /**
     * Filters the settings about to be saved from the admin UI, e.g. to apply a
     * plugin's own from $input. Check every value taken from $input.
     */
    apply_filters( 'wpaic_settings_update', $all, $input );
  • includes/Media/StockPhotos.php line 45
    /**
     * Filters the stock photo services, by id (lowercase letters, digits, - and _;
     * not "off").
     */
    apply_filters( 'wpaic_stock_sources', array( 'openverse' => new Openverse() ) );
  • includes/AI/PromptLibrary.php line 266
    /**
     * Filters the final designer system prompt.
     */
    apply_filters( 'wpaic_system_prompt', $prompt );
  • includes/Design/ThemeStyleExtractor.php line 54
    /**
     * Filters the theme context given to the AI.
     */
    apply_filters( 'wpaic_theme_context', $context );
  • includes/AI/DesignAgent.php line 136
    /**
     * Filters extra lines of a turn's context for the model (not of a review
     * pass).
     */
    apply_filters( 'wpaic_turn_context', array(), array( 'message' => $message, 'spec' => $spec, 'post_id' => $post_id, 'post_type' => $post_type, ) );
  • includes/AI/DesignAgent.php line 403
    /**
     * Filters notes added under the reply and suggestions offered first, after a
     * turn (not a review pass or a cut-off answer).
     */
    apply_filters( 'wpaic_turn_notes', array( 'notes' => array(), 'suggestions' => array(), ), array( 'applied' => $result['applied'], 'message' => $message, 'spec' => $new_spec, 'post_id' => $post_id, 'post_type' => $post_type, ) );
  • includes/Renderers/ThemeStylesheets.php line 61
    do_action( 'wp_enqueue_scripts' );

Generated from AI Content Builder'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.

Plugin 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 this

Not 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: