From e4f03cb892735afaab1d7ec207b9ae3046d7f3dc Mon Sep 17 00:00:00 2001 From: GautamMKGarg Date: Sat, 25 Apr 2026 19:16:01 +0530 Subject: [PATCH] Add check for post existence in admin bar Patch for https://core.trac.wordpress.org/ticket/65128 --- src/wp-includes/admin-bar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/admin-bar.php b/src/wp-includes/admin-bar.php index b9c7872d0cc07..af534a47b414d 100644 --- a/src/wp-includes/admin-bar.php +++ b/src/wp-includes/admin-bar.php @@ -812,7 +812,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) { $post = get_post(); $post_type_object = null; - if ( 'post' === $current_screen->base ) { + if ( 'post' === $current_screen->base && isset( $post ) ) { $post_type_object = get_post_type_object( $post->post_type ); } elseif ( 'edit' === $current_screen->base ) { $post_type_object = get_post_type_object( $current_screen->post_type );