Skip to content

Commit

Permalink
fix: remove unneeded logic
Browse files Browse the repository at this point in the history
If no campaign ID is present an error is thrown, so it's unnecessary to check later.
  • Loading branch information
jeffersonrabb committed Apr 23, 2020
1 parent 203d64b commit 57c8ec0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/class-newspack-newsletters.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ public static function retrieve_data( $id ) {
);
}
$mc = new Mailchimp( self::mailchimp_api_key() );
$campaign = $mc_campaign_id ? self::validate_mailchimp_operation( $mc->get( "campaigns/$mc_campaign_id" ) ) : null;
$campaign = self::validate_mailchimp_operation( $mc->get( "campaigns/$mc_campaign_id" ) );
$list_id = $campaign && isset( $campaign['recipients']['list_id'] ) ? $campaign['recipients']['list_id'] : null;
$interest_categories = $list_id ? self::validate_mailchimp_operation( $mc->get( "lists/$list_id/interest-categories" ) ) : null;
if ( $interest_categories && count( $interest_categories['categories'] ) ) {
Expand Down

0 comments on commit 57c8ec0

Please sign in to comment.