Skip to content

Commit

Permalink
Merge pull request #47 from happyprime/fix/possible-php-notice
Browse files Browse the repository at this point in the history
Ensure `shadow-terms` key exists before checking it
  • Loading branch information
jeremyfelt authored Feb 23, 2024
2 parents 3a637f0 + 40590a4 commit 1b059ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function get_post_id( int $term_id ): int {
function get_connected_post_types( string $post_type ): array {
$supports = get_all_post_type_supports( $post_type );

if ( is_array( $supports['shadow-terms'] ) && is_array( $supports['shadow-terms'][0] ) ) {
if ( isset( $supports['shadow-terms'] ) && is_array( $supports['shadow-terms'] ) && is_array( $supports['shadow-terms'][0] ) ) {
return $supports['shadow-terms'][0];
}

Expand Down

0 comments on commit 1b059ba

Please sign in to comment.