Skip to content

Commit

Permalink
chore(release): merge in release v3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
matticbot committed Aug 15, 2024
2 parents a4df70a + 6a4ffaa commit 06caaec
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [3.0.1](https://github.com/Automattic/newspack-ads/compare/v3.0.0...v3.0.1) (2024-08-15)


### Bug Fixes

* **gam:** add 1x1 size to all viewports ([#888](https://github.com/Automattic/newspack-ads/issues/888)) ([a99494a](https://github.com/Automattic/newspack-ads/commit/a99494a854855a3fd1388d7821db7aeef549adb9))

# [3.0.0](https://github.com/Automattic/newspack-ads/compare/v2.1.0...v3.0.0) (2024-08-13)


Expand Down
23 changes: 10 additions & 13 deletions includes/providers/gam/class-gam-model.php
Original file line number Diff line number Diff line change
Expand Up @@ -855,11 +855,6 @@ public static function get_ad_unit_size_map( $ad_unit, $sizes = [] ) {
$sizes = $ad_unit['sizes'];
}

// Ensure that 1x1 is always available.
if ( ! in_array( [ 1, 1 ], $sizes, true ) ) {
$sizes[] = [ 1, 1 ];
}

/**
* Filters the ad unit size map difference ratio.
*
Expand All @@ -878,21 +873,23 @@ public static function get_ad_unit_size_map( $ad_unit, $sizes = [] ) {
*/
$width_threshold = apply_filters( 'newspack_ads_gam_size_map_width_threshold', 600, $ad_unit, $sizes );

$size_map = self::get_responsive_size_map( $sizes, $width_diff_ratio, $width_threshold );

// Add 1x1 size to all viewports.
foreach ( $size_map as $viewport => $sizes ) {
if ( ! in_array( [ 1, 1 ], $sizes, true ) ) {
array_unshift( $size_map[ $viewport ], [ 1, 1 ] );
}
}

/**
* Filters the ad unit size map rules.
*
* @param array[] $size_map The size map array.
* @param array $ad_unit The ad unit config.
* @param array[] $sizes The sizes being used.
*/
$size_map = apply_filters(
'newspack_ads_gam_size_map',
self::get_responsive_size_map( $sizes, $width_diff_ratio, $width_threshold ),
$ad_unit,
$sizes
);

return $size_map;
return apply_filters( 'newspack_ads_gam_size_map', $size_map, $ad_unit, $sizes );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion newspack-ads.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Ad services integration.
* Author: Automattic
* License: GPL2
* Version: 3.0.0
* Version: 3.0.1
*
* @package Newspack
*/
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "newspack-ads",
"version": "3.0.0",
"version": "3.0.1",
"author": "Automattic",
"private": true,
"scripts": {
Expand Down

0 comments on commit 06caaec

Please sign in to comment.