diff --git a/inc/block-editor.php b/inc/block-editor.php index 889b6f31..a0c9ea38 100644 --- a/inc/block-editor.php +++ b/inc/block-editor.php @@ -44,6 +44,9 @@ if ( ! function_exists( 'understrap_generate_color_palette' ) ) { $color_palette_json = json_decode( $color_palette_json, true ); if ( is_array( $color_palette_json ) ) { foreach ( $color_palette_json as $key => $value ) { + if ( ! is_string( $key ) ) { + continue; + } $key = str_replace( array( '--bs-', '--' ), '', $key ); $color_palette[] = array( 'name' => $key, diff --git a/inc/custom-comments.php b/inc/custom-comments.php index cfe1822a..4a520c50 100644 --- a/inc/custom-comments.php +++ b/inc/custom-comments.php @@ -97,7 +97,11 @@ if ( ! function_exists( 'understrap_comment_form_comments_closed' ) ) { * Displays a note that comments are closed if comments are closed and there are comments. */ function understrap_comment_form_comments_closed() { - if ( get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) { + $post_type = get_post_type(); + if ( false === $post_type ) { + return; + } + if ( get_comments_number() && post_type_supports( $post_type, 'comments' ) ) { ?>

'; echo '
'; echo '
';