diff --git a/projects/plugins/jetpack/modules/wordads/class-wordads.php b/projects/plugins/jetpack/modules/wordads/class-wordads.php index 5be2917ed3a45..a47d09de45c67 100644 --- a/projects/plugins/jetpack/modules/wordads/class-wordads.php +++ b/projects/plugins/jetpack/modules/wordads/class-wordads.php @@ -381,8 +381,16 @@ public function insert_head_meta() { params->blog_id . 5; + + // Get below post tag. + $tag_belowpost = $this->get_fallback_ad_snippet( $section_id, 'square', 'belowpost', '', '{{unique_id}}' ); + + // Remove linebreaks and sanitize. + $tag_belowpost = esc_js( str_replace( array( "\n", "\t", "\r" ), '', $tag_belowpost ) ); + // Get an inline tag with a macro as id handled on JS side to use as a fallback. - $tag_inline = $this->get_fallback_ad_snippet( $this->params->blog_id . 5, 'square', 'inline', '', '{{unique_id}}' ); + $tag_inline = $this->get_fallback_ad_snippet( $section_id, 'square', 'inline', '', '{{unique_id}}' ); // Remove linebreaks and sanitize. $tag_inline = esc_js( str_replace( array( "\n", "\t", "\r" ), '', $tag_inline ) ); @@ -393,6 +401,7 @@ public function insert_head_meta() { var sas_fallback = sas_fallback || []; sas_fallback.push( { tag: "$tag_inline", type: 'inline' } + { tag: "$tag_belowpost", type: 'belowpost' } ); HTML; 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 03cc6353fb830..b879f99bbb0e9 100644 --- a/projects/plugins/jetpack/modules/wordads/php/class-wordads-smart.php +++ b/projects/plugins/jetpack/modules/wordads/php/class-wordads-smart.php @@ -182,7 +182,10 @@ public function insert_config() { 'enabled' => $this->is_inline_enabled, ), 'bottom_sticky' => array( - 'enabled' => true, + 'enabled' => true, // TODO: this will not be true by default + ), + 'belowpost' => array( + 'enabled' => true, // TODO: this will not be true by default ), );