Provide plugins a way of modifying the contents of the automatically-generated ads.txt file.
Parameters
- WordAds_API::get_wordads_ads_txt()
string The contents of the ads.txt file.
Changelog
- Introduced in Jetpack 6.1.0
How to use this hook
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;
}