Skip to content

Commit

Permalink
- Conditions were in the wrong order. We want to check for the existe…
Browse files Browse the repository at this point in the history
…nce of `$args['capabilities']` before typing checking. If the first expression fails we skip the second, otherwise there'll be a PHP error.
  • Loading branch information
ramonjd committed Aug 10, 2023
1 parent c592cc7 commit 88a09b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.4/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}
Expand Down

0 comments on commit 88a09b5

Please sign in to comment.