Action Hooks

Advanced Ads offers a couple of action hooks that you can use to change settings, ad output, or other things. 

You might take a look into the code or simply experiment a bit to learn more about each hook. You can learn more about actions and how to use them from the add_action page on wordpress.org.

advanced-ads-ad-expired

When an ad expired based on the expiry date setting.

See How to react to ad status changes for an example.

advanced-ads-ad-list-details-column-after

After the list of ad details in the ad list in the dashboard

  • file: admin/view/ad_list_details_column.php

parameters:

  • $ad – ad object

advanced-ads-ad-list-timing-column-after

After the timing details in the ad list.

advanced-ads-ad-params-after-{$type}

Target parameters by ad type.

advanced-ads-ad-params-after

Called after rendering the ad parameters. Doesn’t get updated/changed by ad type change.

  • file: admin/views/ad-parameters-metabox.php

parameters:

  • $ad – ad object
  • $types – array with ad types

advanced-ads-ad-params-before

Before the ad parameters are rendered. No update when the ad type changes.

advanced-ads-ad-status-published

This action hook fires when an ad status changes from anything else to publish.

See How to react to ad status changes for an example.

advanced-ads-ad-status-unpublished

This action hook fires when an ad status changes from publish to anything else, including expiring ads.

See How to react to ad status changes for an example.

advanced-ads-ad-status-{$old_status}-to-{$new_status}

This dynamic action hook allows you to react on any specific status changes, e.g, when the ad changes from draft to publish, you can hook into advanced-ads-ad-status-draft-to-publish.

advanced-ads-additional-settings-form

Allow developers to display additional content (forms) in the settings page. Data is not registered in the WP SAPI like the default form, so processing it is left to the developer.

  • file: admin/views/settings.php

advanced-ads-admin-overview-after

Called after rendering the overview page.

  • file: admin/views/overview.php

advanced-ads-admin-overview-before

Called before rendering the overview page.

  • file: admin/views/overview.php

advanced-ads-adsense-parameters-before

Before the Google AdSense ad parameters are rendered.

advanced-ads-adsense-settings-init

Fired after setting init of the AdSense settings.

advanced-ads-ajax-ad-select-init

Fired before an ad is selected via ajax.

advanced-ads-debug-after

At the bottom of the debug page in the dashboard.

advanced-ads-gadsense-extra-ad-param

Allows the display of additional HTML in the AdSense ad param meta box.

  • module: gadsense
  • file: modules/gadsense/admin/views/adsense-ad-parameters.php

parameters:

  • arr $extra_param
  • obj $content, the content object

advanced-ads-group-form-options

Add new form fields to the group form.

advanced-ads-output

Runs after the output of an ad is created, but before being displayed.

advanced-ads-placement-options-after

Add placement options based on placement type after the default options get rendered.

  • file: admin/view/placements.php

parameters:

  • $_placement_slug – slug/id of the current placement $_placement – array with all placement information

advanced-ads-placement-options-before

Add placement options based on placement type before the default options (and even item select) get rendered.

  • file: admin/view/placements.php

parameters:

  • $_placement_slug – slug/id of the current placement $_placement – array with all placement information

advanced-ads-pro-ad-server-{position}

The WordPress Ad Server placement comes with a couple of hooks that allow you to inject content into the ad template.

advanced-ads-pro-ad-server-template-head – the template’s <head> section

advanced-ads-pro-ad-server-template-after-opening-body – after <body>

advanced-ads-pro-ad-server-template-before-closing-body – before </body>

advanced-ads-save-options

Manipulate option parameters or add new options for an ad before saving them

  • file: classes/ad.php
  • function: save()

parameters:

  • $options – array with options
  • $ad – ad object

advanced-ads-selling-ad-setup-form-types-after

Add additional fields to the ad setup page. Find additional information here.

advanced-ads-selling-save-ad-content-after

Store additional information sent from the ad setup page. Find additional information here.

advanced-ads-settings-form

Action to add more settings to the settings form

  • file: admin/views/settings.php

parameters:

  • string $_setting_tab_id, identifier of the setting tab
  • array $_setting_tab, array with setting tab options

advanced-ads-settings-init

Action to add more settings to the settings page after the settings of the main plugin

  • file: admin/class-advanced-ads-admin.php

parameters:

  • $hook – page hook

advanced-ads-submenu-pages

Allow developers to insert sub-menu page bellow the advanced ads menu (top-level menu)

  • file: /admin/class-advanced-ads-admin.php

parameters:

  • string $plugin_slug

advanced-ads-tracking-email-report-below-headline

Add custom text below the headline in the email reports.

advanced-ads-tracking-email-report-below-content

Add custom text below the content in the email reports.

advanced-ads-public-stats-head

Manipulate the head section of the public stats page.

advanced-ads-visitor-conditions-after

Called after rendering the visitor conditions. Doesn’t get updated/changed by ad type change.

  • file: admin/views/ad-visitor-metabox.php

Make it better

Increase your ad management skills without spending more time.
Join over 150,000 publishers and AdOpts increasing their ad revenue.