diff --git a/lib/register.php b/lib/register.php index 0b145103523cf4..1ce55053c0ecab 100644 --- a/lib/register.php +++ b/lib/register.php @@ -292,7 +292,7 @@ function gutenberg_can_edit_post_type( $post_type ) { } $post_type_object = get_post_type_object( $post_type ); - if ( ! $post_type_object->show_in_rest ) { + if ( $post_type_object && ! $post_type_object->show_in_rest ) { $can_edit = false; }