Skip to content

Commit

Permalink
Merge master into add/gam-ad-units
Browse files Browse the repository at this point in the history
  • Loading branch information
adekbadek committed Jun 1, 2021
2 parents 9c85ed1 + e919502 commit 1fd5f75
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions includes/class-newspack-ads-model.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,17 @@ private static function get_legacy_ad_units() {
]
);
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
$legacy_ad_units[] = [
'id' => \get_the_ID(),
'name' => html_entity_decode( \get_the_title(), ENT_QUOTES ) . ' ' . __( '(legacy)', 'newspack' ),
'sizes' => self::sanitize_sizes( \get_post_meta( get_the_ID(), 'sizes', true ) ),
'code' => esc_html( \get_post_meta( get_the_ID(), 'code', true ) ),
'status' => 'ACTIVE',
'is_legacy' => true,
];
foreach ( $query->posts as $post ) {
if ( self::$custom_post_type === $post->post_type ) {
$legacy_ad_units[] = [
'id' => $post->ID,
'name' => html_entity_decode( $post->post_title, ENT_QUOTES ) . ' ' . __( '(legacy)', 'newspack' ),
'sizes' => self::sanitize_sizes( \get_post_meta( $post->ID, 'sizes', true ) ),
'code' => esc_html( \get_post_meta( $post->ID, 'code', true ) ),
'status' => 'ACTIVE',
'is_legacy' => true,
];
}
}
}
return $legacy_ad_units;
Expand Down

0 comments on commit 1fd5f75

Please sign in to comment.