Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #7 from bluehost/bug/dont-store-empty-arrays
Browse files Browse the repository at this point in the history
Don't store empty arrays
  • Loading branch information
wpscholar authored Aug 18, 2022
2 parents 38a6b74 + 8a71cfd commit 81b4a03
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions includes/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ public static function collect() {

if ( ! $bh_cdata ) {
$guapi = self::get_account_info();
$mole = array( 'meta' => self::get_onboarding_info() );
$bh_cdata = array_merge( $guapi, $mole );
$mole = self::get_onboarding_info();
if ( empty( $guapi ) || empty( $mole ) ) {
return false;
}
$bh_cdata = array_merge( $guapi, array( 'meta' => $mole ) );
Transient::set( self::TRANSIENT, $bh_cdata, WEEK_IN_SECONDS );
}

Expand Down

0 comments on commit 81b4a03

Please sign in to comment.