apply_filters ( 'wordads_ads_txt', string WordAds_API::get_wordads_ads_txt() )

Provide plugins a way of modifying the contents of the automatically-generated ads.txt file.

Source file: modules/wordads/wordads.php

View in GitHub

Parameters

WordAds_API::get_wordads_ads_txt()

(string) WordAds_API::get_wordads_ads_txt() The contents of the ads.txt file.


Changelog

Since: Jetpack 6.1.0


Notes

You can use this filter to add your custom texts from other ad programs.

add_filter( 'wordads_ads_txt', 'htdat_wordads_ads_txt'); 

function htdat_wordads_ads_txt ( $ads_txt_transient ) {
  $my_text = "#My custom texts";
  $my_text .= "\r\n"; // new line 	
  $my_text .= "google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0"; // Edit your own text here
  $my_text .= "\r\n \r\n"; // two new lines 
  return $my_text . $ads_txt_transient; 
}  

Have a note to contribute?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s