Ad Inserter 2.8.20 has 3 actions and 21 filters, read directly from its source code on Nov 17, 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 Ad Inserter fires an action
add_action( 'ai-settings-bottom', function() {
// Your code runs here.
}, 10, 1 );
// Change a value Ad Inserter is about to use
add_filter( 'simple_history_log', 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
-
simple_history_log
filterapply_filters( 'simple_history_log', AD_INSERTER_NAME . ' ' . __('settings saved', 'ad-inserter') . ' (' . $history_string . ')' ); -
ai_block_insertion_check
filterapply_filters( 'ai_block_insertion_check', true, $block, false ); -
widget_title
filterapply_filters( 'widget_title', $title ); -
wpml_current_language
filterapply_filters( 'wpml_current_language', null ); -
ai_ad_label
filterapply_filters( 'ai_ad_label', $ad_label ); -
ai_block_ad_label
filterapply_filters( 'ai_block_ad_label', $label_code, $this->number ); -
ai_block_additional_code
filterapply_filters( 'ai_block_additional_code', $additional_code_org, $this->number ); -
ai_block_code
filterapply_filters( 'ai_block_code', $code_org, $this->number ); -
ai_block_code_after_php
filterapply_filters( 'ai_block_code_after_php', $code_org, $this->number ); -
apply_filters( 'ai_block_code_after_processing', $code_org, $this->number ); -
ai_block_code_insertion
filterapply_filters( 'ai_block_code_insertion', $code_org, $this->number ); -
apply_filters( 'ai_block_code_serverside_html_js', $serverside_insertion_code_org, $this->number ); -
apply_filters( 'ai_block_code_serverside_insertion', $code_org, $this->number ); -
apply_filters( 'ai_block_code_single_insertion', $code_org, $this->number ); -
ai_initial_settings
filterapply_filters( 'ai_initial_settings', $initial_settings ); -
ai_php_enabled
filterapply_filters( 'ai_php_enabled', $php_enabled ); -
ai_save_multisite_options
filterapply_filters( 'ai_save_multisite_options', $multisite_options ); -
ai_save_options
filterapply_filters( 'ai_save_options', $options ); -
ai_save_settings
filterapply_filters( 'ai_save_settings', $ai_options ); -
ai-settings-bottom
actiondo_action( 'ai-settings-bottom' ); -
ai-settings-name-prefix
actiondo_action( 'ai-settings-name-prefix' ); -
do_action( 'litespeed_control_set_nocache', sprintf (__('Caching disabled by %s settings', 'ad-inserter'), AD_INSERTER_NAME) ); -
plugin_locale
filterapply_filters( 'plugin_locale', (is_admin() && function_exists ('get_user_locale')) ? get_user_locale() : get_locale(), $domain ); -
wpml_active_languages
filterapply_filters( 'wpml_active_languages', null, 'orderby=id&order=desc' );
Generated from Ad Inserter's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: