Skip to content

Commit

Permalink
WordAds: ensure that ads.txt works on subdirectory websites (#36887)
Browse files Browse the repository at this point in the history
* Enable ads.txt on WP multisite

* changelog
  • Loading branch information
diogoca authored Apr 29, 2024
1 parent 5aa9ad2 commit 9427b68
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/feature-ads-txt-multisite
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: enhancement

WordAds: ensure that ads.txt works on subdirectory websites.
3 changes: 2 additions & 1 deletion projects/plugins/jetpack/modules/wordads/class-wordads.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ public function init() {
WordAds_Consent_Management_Provider::init();
}

if ( isset( $_SERVER['REQUEST_URI'] ) && '/ads.txt' === $_SERVER['REQUEST_URI'] ) {
if ( ( isset( $_SERVER['REQUEST_URI'] ) && '/ads.txt' === $_SERVER['REQUEST_URI'] )
|| ( site_url( 'ads.txt', 'relative' ) === $_SERVER['REQUEST_URI'] ) ) {

$ads_txt_transient = get_transient( 'wordads_ads_txt' );

Expand Down

0 comments on commit 9427b68

Please sign in to comment.