Skip to content

Commit

Permalink
Merge pull request #122 from newfold-labs/fix/fatal-with-no-capabilit…
Browse files Browse the repository at this point in the history
…ies-PRESS10-107

Ensure `all` method returns an empty array if capabilities are not available
  • Loading branch information
circlecube authored Jan 22, 2025
2 parents 71ee589 + 59b114d commit f54e2f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/SiteCapabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function all(): array {
$this->transient->set( 'nfd_site_capabilities', $capabilities, 4 * constant( 'HOUR_IN_SECONDS' ) );
}

return $capabilities;
return is_array( $capabilities ) ? $capabilities : array();
}

/**
Expand Down

0 comments on commit f54e2f4

Please sign in to comment.