Ad Inserter icon
Ads & Monetisation

Ad Inserter hooks reference

  • By Spacetime
  • v2.8.20
  • Updated

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.

functions.phpyour child theme
// 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

  • ad-inserter.php line 8454 · used in 11 places
    apply_filters( 'simple_history_log', AD_INSERTER_NAME . ' ' . __('settings saved', 'ad-inserter') . ' (' . $history_string . ')' );
  • ad-inserter.php line 11707 · used in 2 places
    apply_filters( 'ai_block_insertion_check', true, $block, false );
  • widget_title

    filter
    ad-inserter.php line 10707 · used in 2 places
    apply_filters( 'widget_title', $title );
  • class.php line 9032 · used in 2 places
    apply_filters( 'wpml_current_language', null );
  • ai_ad_label

    filter
    ad-inserter.php line 12880
    apply_filters( 'ai_ad_label', $ad_label );
  • class.php line 2439
    apply_filters( 'ai_block_ad_label', $label_code, $this->number );
  • class.php line 3221
    apply_filters( 'ai_block_additional_code', $additional_code_org, $this->number );
  • ai_block_code

    filter
    class.php line 404
    apply_filters( 'ai_block_code', $code_org, $this->number );
  • class.php line 471
    apply_filters( 'ai_block_code_after_php', $code_org, $this->number );
  • class.php line 5120
    apply_filters( 'ai_block_code_after_processing', $code_org, $this->number );
  • class.php line 5522
    apply_filters( 'ai_block_code_insertion', $code_org, $this->number );
  • class.php line 5677
    apply_filters( 'ai_block_code_serverside_html_js', $serverside_insertion_code_org, $this->number );
  • class.php line 5710
    apply_filters( 'ai_block_code_serverside_insertion', $code_org, $this->number );
  • class.php line 5412
    apply_filters( 'ai_block_code_single_insertion', $code_org, $this->number );
  • ad-inserter.php line 7601
    apply_filters( 'ai_initial_settings', $initial_settings );
  • ad-inserter.php line 12943
    apply_filters( 'ai_php_enabled', $php_enabled );
  • ad-inserter.php line 5548
    apply_filters( 'ai_save_multisite_options', $multisite_options );
  • ad-inserter.php line 5547
    apply_filters( 'ai_save_options', $options );
  • ad-inserter.php line 8318
    apply_filters( 'ai_save_settings', $ai_options );
  • settings.php line 3840
    do_action( 'ai-settings-bottom' );
  • settings.php line 294
    do_action( 'ai-settings-name-prefix' );
  • ad-inserter.php line 110
    do_action( 'litespeed_control_set_nocache', sprintf (__('Caching disabled by %s settings', 'ad-inserter'), AD_INSERTER_NAME) );
  • plugin_locale

    filter
    includes/dst/dst.php line 277
    apply_filters( 'plugin_locale', (is_admin() && function_exists ('get_user_locale')) ? get_user_locale() : get_locale(), $domain );
  • ad-inserter.php line 11638
    apply_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: