From 2e276addb9bbf0f511eba55d12bf84c02b1b5fc7 Mon Sep 17 00:00:00 2001 From: Thorsten Frommen Date: Tue, 16 Jan 2018 22:27:50 +0100 Subject: [PATCH] Simplify control flow. (#4458) --- gutenberg.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gutenberg.php b/gutenberg.php index 2e0325cbd3ce19..3ca27ecfb26a04 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -193,13 +193,13 @@ function gutenberg_intercept_edit_post() { $post = get_post( $post_id ); // Errors and invalid requests are handled in post.php, do not intercept. - if ( $post ) { - $post_type = $post->post_type; - $post_type_object = get_post_type_object( $post_type ); - } else { + if ( ! $post ) { return; } + $post_type = $post->post_type; + $post_type_object = get_post_type_object( $post_type ); + if ( ! $post_type_object ) { return; }