Skip to content

Commit d0f48d7

Browse files
authored
Merge pull request #18026 from Yoast/hide-non-empty-excluded-posttypes
FIX-61 Hide non empty excluded posttypes
2 parents 1390ba0 + 3571513 commit d0f48d7

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"Yoast\\WP\\SEO\\Composer\\Actions::check_coding_standards"
7979
],
8080
"check-cs-thresholds": [
81-
"@putenv YOASTCS_THRESHOLD_ERRORS=242",
81+
"@putenv YOASTCS_THRESHOLD_ERRORS=245",
8282
"@putenv YOASTCS_THRESHOLD_WARNINGS=198",
8383
"Yoast\\WP\\SEO\\Composer\\Actions::check_cs_thresholds"
8484
],

inc/sitemaps/class-post-type-sitemap-provider.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ protected function get_non_empty_types() {
4242
->select_many( 'object_sub_type' )
4343
->find_array();
4444
$indexed_archives = wp_list_pluck( $indexed_archives, 'object_sub_type' );
45+
$indexed_archives = array_filter( $indexed_archives, function ( $post_type ) {
46+
return ! $this->should_exclude_object_sub_type( $post_type );
47+
} );
4548

4649
// Post and page sitemaps always get a link to the homepage or posts page.
4750
return array_merge( $indexed_archives, [ 'post', 'page' ] );

0 commit comments

Comments
 (0)