mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Sitemaps: Exclude post types and taxonomies that are not publicly queryable.
Props Cybr. Fixes #50607. git-svn-id: https://develop.svn.wordpress.org/trunk@48474 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -37,6 +37,8 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider {
|
||||
$post_types = get_post_types( array( 'public' => true ), 'objects' );
|
||||
unset( $post_types['attachment'] );
|
||||
|
||||
$post_types = array_filter( $post_types, 'is_post_type_viewable' );
|
||||
|
||||
/**
|
||||
* Filters the list of post object sub types available within the sitemap.
|
||||
*
|
||||
|
||||
@@ -35,6 +35,8 @@ class WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {
|
||||
public function get_object_subtypes() {
|
||||
$taxonomies = get_taxonomies( array( 'public' => true ), 'objects' );
|
||||
|
||||
$taxonomies = array_filter( $taxonomies, 'is_taxonomy_viewable' );
|
||||
|
||||
/**
|
||||
* Filter the list of taxonomy object subtypes available within the sitemap.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user