From dbd0f508a70fbf8e86de47f1ccad41e5c317bd1e Mon Sep 17 00:00:00 2001 From: Konstantinos Galanakis Date: Thu, 16 May 2024 16:47:42 +0300 Subject: [PATCH] Prevent fatal error when filtered block categories array is null. --- includes/blocks.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/blocks.php b/includes/blocks.php index e87f3042..fd2f9f00 100644 --- a/includes/blocks.php +++ b/includes/blocks.php @@ -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(