From e05f49bae64a45f85ed3f5442f97e676c352e903 Mon Sep 17 00:00:00 2001 From: Akshit Sethi Date: Tue, 10 May 2022 14:12:36 +0530 Subject: [PATCH] Fix nitpicks --- includes/ConvertToBlocks/Settings.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/ConvertToBlocks/Settings.php b/includes/ConvertToBlocks/Settings.php index 4f6a411..66afee9 100644 --- a/includes/ConvertToBlocks/Settings.php +++ b/includes/ConvertToBlocks/Settings.php @@ -236,10 +236,17 @@ public function sanitize_post_types( $input ) { public function supported_post_types( $supports, $post_type ) { $supported_post_types = get_option( sprintf( '%s_post_types', CONVERT_TO_BLOCKS_SLUG ) ); - if ( ! $supported_post_types ) { + // If the settings option does not exist in DB. + if ( false === $supported_post_types ) { return $supports; } + // If no post_type is selected. + if ( empty( $supported_post_types ) ) { + return false; + } + + // Check if post_type is selected by the user. if ( in_array( $post_type, $supported_post_types, true ) ) { return true; }