diff --git a/projects/plugins/jetpack/changelog/update-iponweb-to-watl-migration b/projects/plugins/jetpack/changelog/update-iponweb-to-watl-migration index 646c60484e2bd..bd85e9ccf4478 100644 --- a/projects/plugins/jetpack/changelog/update-iponweb-to-watl-migration +++ b/projects/plugins/jetpack/changelog/update-iponweb-to-watl-migration @@ -1,4 +1,4 @@ Significance: patch Type: other -Migration from IPONWEB to WATL +Migration from IPONWEB to WATL diff --git a/projects/plugins/jetpack/modules/wordads/class-wordads.php b/projects/plugins/jetpack/modules/wordads/class-wordads.php index db618038ef95c..0d389e87c806e 100644 --- a/projects/plugins/jetpack/modules/wordads/class-wordads.php +++ b/projects/plugins/jetpack/modules/wordads/class-wordads.php @@ -371,9 +371,43 @@ public function insert_head_meta() { $site_id = $this->params->blog_id; $consent = (int) isset( $_COOKIE['personalized-ads-consent'] ); $is_logged_in = is_user_logged_in() ? '1' : '0'; + + $disabled_slot_formats = apply_filters( 'wordads_disabled_slot_formats', array() ); + + if ( apply_filters( 'wordads_iponweb_bottom_sticky_ad_disable', false ) ) { + $disabled_slot_formats[] = 'MTS'; + } + + if ( apply_filters( 'wordads_iponweb_sidebar_sticky_right_ad_disable', false ) ) { + $disabled_slot_formats[] = 'DPR'; + } + + $config = array( + 'pt' => $pagetype, + 'ht' => $hosting_type, + 'tn' => get_stylesheet(), + 'uloggedin' => $is_logged_in, + 'amp' => false, + 'siteid' => $site_id, + 'consent' => $consent, + 'ad' => array( + 'label' => array( + 'text' => __( 'Advertisements', 'jetpack' ), + ), + 'reportAd' => array( + 'text' => __( 'Report this ad', 'jetpack' ), + ), + 'privacySettings' => array( + 'text' => __( 'Privacy', 'jetpack' ), + 'onClick' => 'js:function() { window.__tcfapi && window.__tcfapi(\'showUi\'); }', + ), + ), + 'disabled_slot_formats' => $disabled_slot_formats, + ); + $js_config = WordAds_Array_Utils::array_to_js_object( $config ); ?> type="text/javascript"> - var __ATA_PP = { pt: , ht: , tn: '', uloggedin: , amp: false, siteid: , consent: , ad: { label: { text: '' }, reportAd: { text: '' }, privacySettings: { text: '', onClick: function() { window.__tcfapi && window.__tcfapi('showUi'); } } } }; + var __ATA_PP = ; var __ATA = __ATA || {}; __ATA.cmd = __ATA.cmd || []; __ATA.criteo = __ATA.criteo || {}; @@ -403,11 +437,11 @@ public function insert_head_meta() { // phpcs:disable WordPress.Security.EscapeOutput.HeredocOutputNotEscaped echo << + diff --git a/projects/plugins/jetpack/modules/wordads/php/class-wordads-smart.php b/projects/plugins/jetpack/modules/wordads/php/class-wordads-smart.php index 7852d599d838b..a60da8234ef77 100644 --- a/projects/plugins/jetpack/modules/wordads/php/class-wordads-smart.php +++ b/projects/plugins/jetpack/modules/wordads/php/class-wordads-smart.php @@ -196,6 +196,16 @@ private function insert_ads() { ); } } + + if ( $this->formats['bottom_sticky']['enabled'] ) { + // Disable IPW slot. + add_filter( 'wordads_iponweb_bottom_sticky_ad_disable', '__return_true', 10 ); + } + + if ( $this->formats['sidebar_sticky_right']['enabled'] ) { + // Disable IPW slot. + add_filter( 'wordads_iponweb_sidebar_sticky_right_ad_disable', '__return_true', 10 ); + } } /**