CAOS 5.0.3 has 14 actions and 34 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 CAOS fires an action
add_action( 'caos_add_script_after_tracking_code', function( $handle, $arg2 ) {
// Your code runs here.
}, 10, 2 );
// Change a value CAOS is about to use
add_filter( 'caos_cloudflare_compatibility', 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
-
/** * Allow WP DEVs to add additional JS after Gtag tracking code. */ do_action( 'caos_add_script_after_tracking_code', $this->handle, CAOS::get( CAOS_Admin_Settings::CAOS_BASIC_SETTING_MEASUREMENT_ID ) ); -
/** * Always run Cloudflare compatibility, because it shouldn't do any harm. */ apply_filters( 'caos_cloudflare_compatibility', true ); -
caos_exclude_from_tracking
filter/** * Allow WP Dev's to halt the rendering of the tracking code, effectively * excluding the page from tracking. Example: * add_filter('caos_exclude_from_tracking', '__return_true'); */ apply_filters( 'caos_exclude_from_tracking', false ); -
/** * Setting this to true disables the required JS to run Consent Mode. */ apply_filters( 'caos_frontend_tracking_consent_mode', false ); -
/** * Allows for adding additional defaults as HTML to Google Analytics' Consent * Mode, e.g. gtag('consent', 'default', {s 'ad_storage': 'denied' }); */ do_action( 'caos_frontend_tracking_consent_mode_defaults' ); -
/** * Setting this to true disables the "listening" part of the Consent Mode * script to allow Cookie Notice plugins or other Google Analytics plugins to * update the Consent state. */ apply_filters( 'caos_frontend_tracking_consent_mode_listener', false ); -
/** * Allows for triggering additional update queries to Google Analytics' Consent * Mode framework. */ do_action( 'caos_frontend_tracking_consent_mode_listener_update' ); -
/** * Allow WP DEVs to add additional JS before Gtag tracking code. */ do_action( 'caos_inline_scripts_before_tracking_code', $this->handle, CAOS::get( CAOS_Admin_Settings::CAOS_BASIC_SETTING_MEASUREMENT_ID ) ); -
caos_process_settings
action/** * Allows WP DEV's to modify the output of the tracking code. E.g. * add_action('caos_process_settings', 'your_function_name'); */ do_action( 'caos_process_settings' ); -
caos_update_settings
action/** * Additional update actions can be added here. */ do_action( 'caos_update_settings' ); -
/** * Any options that're better off in their own DB row (e.g. due to size) can be * added using this filter. */ apply_filters( 'caos_update_settings_serialized', [ 'caos_settings', ] ); -
caos_settings_page_title
filterapply_filters( 'caos_settings_page_title', 'CAOS' ); -
{$name}_setting_description
filterapply_filters( "{$name}_setting_description", __( 'Send an event to Google Analytics whenever a Cloaked Affiliate Link is clicked. An event with the configured <strong>Event Category</strong> is sent to Google Analytics whenever a link containing the <strong>Path</strong> value is clicked. The <strong>Event Label</strong> will be the URL of the link. Depending on your server\'s capacity, this might not work properly with Stealth Mode enabl... ); -
{$name}_setting_label
filterapply_filters( "{$name}_setting_label", $label ); -
apply_filters( 'caos_frontend_tracking_promo_message', true ); -
{$name}setting_description
filterapply_filters( "{$name}setting_description", $description, $label, $name ); -
apply_filters( "{$select}_setting_description", $description, $label, $select ); -
{$select}_setting_label
filterapply_filters( "{$select}_setting_label", $label ); -
{$select}_setting_options
filterapply_filters( "{$select}_setting_options", $options ); -
apply_filters( "{str_replace('-','_',$this->active_tab)}_content", '' ); -
after_{$current_section}
actiondo_action( "after_{$current_section}" ); -
caos_admin_update_after
actiondo_action( 'caos_admin_update_after' ); -
caos_admin_update_before
actiondo_action( 'caos_admin_update_before' ); -
caos_before_admin
actiondo_action( 'caos_before_admin' ); -
caos_before_frontend
actiondo_action( 'caos_before_frontend' ); -
caos_buffer_output
filterapply_filters( 'caos_buffer_output', $html ); -
caos_cron_update
actiondo_action( 'caos_cron_update' ); -
caos_cron_update_gtag
filterapply_filters( 'caos_cron_update_gtag', $downloaded_file ); -
caos_db_migration_v460
filterapply_filters( 'caos_db_migration_v460', [ 'service_provider', CAOS_Admin_Settings::CAOS_BASIC_SETTING_TRACK_ADMIN, 'domain_name', 'tracking_id', 'dual_tracking', 'ga4_measurement_id', CAOS_Admin_Settings::CAOS_BASIC_SETTING_ALLOW_TRACKING, 'snippet_type', 'anonymize_ip_mode', CAOS_Admin_Settings::CAOS_BASIC_SETTING_SCRIPT_POSITION, 'adjusted_bounce_rate', CAOS_Admin_Settings::CAOS_ADV_SETTING_COMPATIBILITY_MODE, 'analytics_js_file', ... ); -
caos_db_migration_v470
filterapply_filters( 'caos_db_migration_v470', [ 'service_provider', 'tracking_id', 'domain_name', 'dual_tracking', 'ga4_measurement_id', 'snippet_type', 'adjusted_bounce_rate', 'analytics_js_file', 'ga_cookie_expiry_days', 'site_speed_sample_rate', 'extension_track_ad_blockers', 'extension_linkid', 'capture_outbound_links', ] ); -
caos_file_alias
filterapply_filters( 'caos_file_alias', $file_aliases[ $file ] ?? '' ); -
apply_filters( 'caos_frontend_add_dns_prefetch', true ); -
caos_gtag_hit_type
filterapply_filters( 'caos_gtag_hit_type', '"page_view"' ); -
caos_local_dir
filterapply_filters( 'caos_local_dir', WP_CONTENT_DIR . self::get( CAOS_Admin_Settings::CAOS_ADV_SETTING_CACHE_DIR, '/uploads/caos/' ) ); -
caos_local_file_url
filterapply_filters( 'caos_local_file_url', $url ); -
apply_filters( 'caos_manual_download_review_link', $this->review ); -
apply_filters( 'caos_manual_download_tweet_link', $this->tweet ); -
caos_register_settings
filterapply_filters( 'caos_register_settings', $reflection->getConstants() ); -
apply_filters( 'caos_register_settings_needle', 'CAOS_BASIC_SETTING' ); -
caos_setting_{$name}
filterapply_filters( "caos_setting_{$name}", $value ); -
caos_settings
filterapply_filters( 'caos_settings', $settings ); -
caos_settings_content
actiondo_action( 'caos_settings_content' ); -
caos_settings_help_faq_link
filterapply_filters( 'caos_settings_help_faq_link', 'https://daan.dev/docs/caos-troubleshooting/?collection_id=6171c32112c07c18afddfcce' ); -
apply_filters( 'caos_settings_help_quick_start', 'https://daan.dev/docs/caos/quick-start-caos/' ); -
apply_filters( 'caos_settings_help_review_link', 'https://wordpress.org/support/plugin/host-analyticsjs-local/reviews/?rate=5#new-post' ); -
apply_filters( 'caos_settings_help_support_link', 'https://daan.dev/contact/' ); -
apply_filters( 'caos_settings_help_user_manual', 'https://daan.dev/docs/caos/?collection_id=6171c32112c07c18afddfcce' ); -
caos_settings_tab
actiondo_action( 'caos_settings_tab' );
Generated from CAOS'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: