Hooks & Filters
Actions
| Hook | Args | Description |
|---|---|---|
oads_zone | string $section, string $format | Render an ad zone |
oads_save_ad_meta | int $ad_id, array $post_data | Fires after an ad is saved via AJAX |
oads_admin_type_options | — | Add <option> tags to the ad type select |
oads_admin_modal_type_fields | — | Add custom type field sections to the editor modal |
Filters
| Filter | Args | Description |
|---|---|---|
oads_render_ad_card | string $html, WP_Post $ad, string $section, array $data | Override rendered card HTML |
oads_render_inline_ad | string $html, WP_Post $ad, string $section, array $data | Override inline ad HTML |
oads_ad_js_data | array $data, int $ad_id | Extend data passed to oadsAdData JS object |
Settings Reference
Stored in get_option('oads_settings'). Access via oads_setting( 'key', $default ).
| Key | Type | Default | Description |
|---|---|---|---|
gdpr_consent | '0'/'1' | '0' | Require localStorage consent before tracking |
disclosure_label | string | 'Sponsored' | Default ad label text |
freq_cap_default | int | 0 | Global default frequency cap (0 = off) |
adsense_pub_id | string | '' | 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.
