Skip to content

Commit

Permalink
Prevent 'Automatic conversion of false to array' deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
JoryHogeveen authored Aug 31, 2023
1 parent 75c9c06 commit 76e65b0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,9 @@ public function archive_test() {
$archive_test = pods_transient_get( $key );

if ( $archive_test === false ) {
$front = $this->front_end( true );
$auto_pods = $front->auto_pods();
$archive_test = [];
$front = $this->front_end( true );
$auto_pods = $front->auto_pods();

foreach ( $auto_pods as $name => $pod ) {
if ( ! $pod['has_archive'] && $pod['archive'] && 'post_type' === $pod['type'] && ! in_array(
Expand All @@ -414,12 +415,11 @@ public function archive_test() {
}
}

pods_transient_set( $key, $archive_test, WEEK_IN_SECONDS );
pods_transient_set( $key, $archive_test ?: false, WEEK_IN_SECONDS );

}

return $archive_test;

}

/**
Expand Down

0 comments on commit 76e65b0

Please sign in to comment.