Skip to content

Commit

Permalink
Prevent fatal error when filtered block categories array is null.
Browse files Browse the repository at this point in the history
  • Loading branch information
kmgalanakis committed May 16, 2024
1 parent a9a7c69 commit dbd0f50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ function register_blocks() {
* @return array Filtered categories.
*/
function blocks_categories( $categories ) {
if ( ! is_array( $categories ) ) {
$categories = [];
}

return array_merge(
$categories,
array(
Expand Down

0 comments on commit dbd0f50

Please sign in to comment.