From 4b192f4f1755bfc75f4a4902b7cb1bea7c707e60 Mon Sep 17 00:00:00 2001 From: sgillot Date: Wed, 27 Nov 2024 12:29:56 +0100 Subject: [PATCH] issue/76995 : undefined array key 0 issue --- classes/admin/admin-restrictions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/admin/admin-restrictions.php b/classes/admin/admin-restrictions.php index cda09ad..730cb6e 100644 --- a/classes/admin/admin-restrictions.php +++ b/classes/admin/admin-restrictions.php @@ -223,7 +223,7 @@ public static function map_meta_cap( $caps, $cap, $user_id, $args ) { } if ( in_array( $cap, $capabilities ) ) { - $post = get_post( $args[0] ); + $post = isset( $args[0] ) ? get_post( $args[0] ) : null; if ( empty( $post ) || is_wp_error( $post ) ) { return $caps; }