Overview
OAds (v2.0.0) is a native ad manager for WordPress publishers who sell ads directly to advertisers. It is not a Google AdSense wrapper or ad-network proxy — it manages ads you control entirely.
Constants:
phpdefine( 'OADS_VERSION', '2.0.0' );
define( 'OADS_DIR', plugin_dir_path( __FILE__ ) );
define( 'OADS_URL', plugin_dir_url( __FILE__ ) );
On activation, OAds creates 4 database tables, registers the oads_ad CPT, and adds a URL rewrite rule for click tracking (/oads-click/{id}/).
Ad Types
| Type key | Description | Required meta keys | |
|---|---|---|---|
image | Banner ad — image + optional overlay headline | _oads_image_url, _oads_image_id, _oads_destination_url | |
text | Text card — headline + body + CTA button | _oads_text_headline, _oads_text_body, _oads_text_cta, _oads_destination_url | |
html | Raw HTML/script embed (passes through wp_kses_post) | _oads_html_embed | |
video | Self-hosted MP4 or YouTube embed | _oads_video_url, _oads_video_type (self | youtube) |
sponsored | Sponsored content card — image + headline + desc + CTA | _oads_sponsored_headline, _oads_sponsored_desc, _oads_sponsored_img_url | |
sticky | Fixed top/bottom bar with close button | _oads_sticky_position (top | bottom) |
All ads carry a disclosure label (default: "Sponsored") configurable per ad. Video ads use IntersectionObserver to start/stop playback on scroll.
