Skip to content

Commit 342c79b

Browse files
Merge pull request #163 from BeAPI/issue/76995
issue/76995 : undefined array key 0 issue
2 parents a48058e + 4b192f4 commit 342c79b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

classes/admin/admin-restrictions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public static function map_meta_cap( $caps, $cap, $user_id, $args ) {
223223
}
224224

225225
if ( in_array( $cap, $capabilities ) ) {
226-
$post = get_post( $args[0] );
226+
$post = isset( $args[0] ) ? get_post( $args[0] ) : null;
227227
if ( empty( $post ) || is_wp_error( $post ) ) {
228228
return $caps;
229229
}

0 commit comments

Comments
 (0)