DocsOAdsHooks, Filters & Settings
Developer

Hooks, Filters & Settings

OAdsorravo.com/docs/oads/hooks-filters-settings

Hooks & Filters

Actions

HookArgsDescription
oads_zonestring $section, string $formatRender an ad zone
oads_save_ad_metaint $ad_id, array $post_dataFires after an ad is saved via AJAX
oads_admin_type_optionsAdd <option> tags to the ad type select
oads_admin_modal_type_fieldsAdd custom type field sections to the editor modal

Filters

FilterArgsDescription
oads_render_ad_cardstring $html, WP_Post $ad, string $section, array $dataOverride rendered card HTML
oads_render_inline_adstring $html, WP_Post $ad, string $section, array $dataOverride inline ad HTML
oads_ad_js_dataarray $data, int $ad_idExtend data passed to oadsAdData JS object

Settings Reference

Stored in get_option('oads_settings'). Access via oads_setting( 'key', $default ).

KeyTypeDefaultDescription
gdpr_consent'0'/'1''0'Require localStorage consent before tracking
disclosure_labelstring'Sponsored'Default ad label text
freq_cap_defaultint0Global default frequency cap (0 = off)
adsense_pub_idstring''Global AdSense publisher ID for zone fallbacks

GDPR consent gate

When enabled, the frontend JS checks localStorage.getItem('oads_consent') === '1' before firing tracking. Your CMP should set this on consent:

javascriptlocalStorage.setItem('oads_consent', '1');

Uninstall

Deleting the plugin permanently drops all 4 tables, deletes all oads_* options, and permanently deletes all oads_ad posts and their meta. Export CSV analytics first.

Hooks, Filters & Settings — OAds Docs — Orravo