Skip to content

Commit

Permalink
$filtered_type_pages is not longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ilicfilip committed Dec 27, 2024
1 parent f7c501b commit 77b79dd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions classes/class-page-types.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,17 +325,14 @@ public function get_default_page_id_by_type( $page_type ) {
}

// Exclude the homepage and any pages that are already assigned to another page-type.
$filtered_type_pages = $types_pages;
$filtered_type_pages['homepage'] = [ $homepage_id ];

foreach ( $defined_page_types as $defined_page_type ) {

// Skip the current page-type.
if ( $page_type === $defined_page_type ) {
continue;
}

$posts = \array_diff( $posts, $filtered_type_pages[ $defined_page_type ] );
$posts = \array_diff( $posts, $types_pages[ $defined_page_type ] );
}

return empty( $posts ) ? 0 : $posts[0];
Expand Down

0 comments on commit 77b79dd

Please sign in to comment.