Sitemaps: Ensure entry for ‘page’ post type sitemap in index.
If there are no pages and no static homepage, there will still be one sitemap including the homepage URL. This change ensures that this sitemap is correctly listed in the sitemap index. Props Chouby, pacifika, elrae. Fixes #50571. Built from https://develop.svn.wordpress.org/trunk@48476 git-svn-id: http://core.svn.wordpress.org/trunk@48245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5eb3f0ffcb
commit
2c92383b8d
|
@ -174,7 +174,8 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider {
|
|||
|
||||
$query = new WP_Query( $args );
|
||||
|
||||
return isset( $query->max_num_pages ) ? $query->max_num_pages : 1;
|
||||
$min_num_pages = ( 'page' === $post_type && 'posts' === get_option( 'show_on_front' ) ) ? 1 : 0;
|
||||
return isset( $query->max_num_pages ) ? max( $min_num_pages, $query->max_num_pages ) : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.5-beta1-48475';
|
||||
$wp_version = '5.5-beta1-48476';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue