Skip to content

Commit

Permalink
replace inline ad condition with any ad format enabled check
Browse files Browse the repository at this point in the history
  • Loading branch information
Alameen688 committed Nov 28, 2024
1 parent ce53214 commit 12ab4f2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ public function init( WordAds_Params $params ) {
// TODO: refactor to remove the need to do this
$this->is_inline_enabled = $this->formats['inline']['enabled'];

// Insert ads.
$this->insert_ads();
// TODO: Is this necessary? if we want to always run Smart insert ads logic after IPW migrations
$has_any_format_enabled = in_array( true, array_column( $this->formats, 'enabled' ), true );
if ( $has_any_format_enabled ) {
// Insert ads.
$this->insert_ads();
}
}

/**
Expand Down

0 comments on commit 12ab4f2

Please sign in to comment.