Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/wp-admin/includes/class-wp-site-icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ class WP_Site_Icon {
/*
* App icon for Android/Chrome.
*
* @link https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android
* @link https://developer.chrome.com/multidevice/android/installtohomescreen
* @link https://developer.chrome.com/blog/support-for-theme-color-in-chrome-39-for-android
*/
192,

Expand Down
21 changes: 21 additions & 0 deletions src/wp-includes/sitemaps/class-wp-sitemaps.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function init() {

// Add additional action callbacks.
add_filter( 'robots_txt', array( $this, 'add_robots' ), 0, 2 );
add_filter( 'pre_handle_404', array( $this, 'prevent_sitemap_404' ), 10, 2 );
}

/**
Expand Down Expand Up @@ -263,4 +264,24 @@ public function add_robots( $output, $is_public ) {

return $output;
}

/**
* Prevents core from issuing a 404 status header on valid sitemap requests
* when no standard blog posts exist.
*
* @since 6.8.0
*
* @param bool $preempt Whether to short-circuit default 404 handling.
* @param WP_Query $query The global WP_Query object.
* @return bool True to preempt 404 handling if a valid sitemap route is requested, original $preempt otherwise.
*/
public function prevent_sitemap_404( $preempt, $query ) {
if ( $query->is_main_query() && get_query_var( 'sitemap' ) ) {
if ( $this->sitemaps_enabled() ) {
return true;
}
}

return $preempt;
}
}
Loading