From 88a09b5d23051e0cbb150ff78f4024bc6ef27c49 Mon Sep 17 00:00:00 2001 From: ramon Date: Thu, 10 Aug 2023 15:20:58 +1000 Subject: [PATCH] - Conditions were in the wrong order. We want to check for the existence of `$args['capabilities']` before typing checking. If the first expression fails we skip the second, otherwise there'll be a PHP error. --- lib/compat/wordpress-6.4/blocks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compat/wordpress-6.4/blocks.php b/lib/compat/wordpress-6.4/blocks.php index 3252bfbf5fe26..74fa9253e45d5 100644 --- a/lib/compat/wordpress-6.4/blocks.php +++ b/lib/compat/wordpress-6.4/blocks.php @@ -14,7 +14,7 @@ */ function gutenberg_add_custom_capabilities_to_wp_block( $args ) { if ( is_array( $args ) ) { - if ( is_array( $args['capabilities'] ) || ! isset( $args['capabilities'] ) ) { + if ( ! isset( $args['capabilities'] ) || is_array( $args['capabilities'] ) ) { $args['capabilities']['delete_posts'] = 'delete_posts'; } }