Skip to content

Commit

Permalink
fix conditional that fails linting now
Browse files Browse the repository at this point in the history
todo: this could be cleaned up to bail earlier if empty($sites) but I don't want to risk breakage right now.
  • Loading branch information
jazzsequence committed Jul 10, 2024
1 parent 4a3818b commit f98bde0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/class-decoupled-preview-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,10 @@ public function get_enabled_site_by_post_type( string $post_type ): ?array {
$enable_sites = [];
if ( ! empty( $sites ) ) {
foreach ( $sites['preview'] as $site ) {
if ( ! isset( $site['content_type'] ) || isset( $site['content_type'] ) && in_array( $post_type, $site['content_type'], true ) ) {
if (
! isset( $site['content_type'] ) ||
( isset( $site['content_type'] ) && in_array( $post_type, $site['content_type'], true ) )
) {
$enable_sites[] = $site;
}
}
Expand Down

0 comments on commit f98bde0

Please sign in to comment.