Skip to content

Commit

Permalink
Fix nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
akshitsethi committed May 10, 2022
1 parent ef4e2cb commit e05f49b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion includes/ConvertToBlocks/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e05f49b

Please sign in to comment.