Permalinks: Avoid a PHP notice in `wp_resolve_numeric_slug_conflicts()` when visiting a day archive with the `/%postname%/` permalink structure.

Props thakkarhardik, thomstark.
Fixes #46828.
Built from https://develop.svn.wordpress.org/trunk@45214


git-svn-id: http://core.svn.wordpress.org/trunk@45023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-04-16 15:34:52 +00:00
parent 464535d0d3
commit 39b82b89be
2 changed files with 3 additions and 3 deletions

View File

@ -376,9 +376,9 @@ function wp_resolve_numeric_slug_conflicts( $query_vars = array() ) {
$compare = '';
if ( 0 === $postname_index && ( isset( $query_vars['year'] ) || isset( $query_vars['monthnum'] ) ) ) {
$compare = 'year';
} elseif ( '%year%' === $permastructs[ $postname_index - 1 ] && ( isset( $query_vars['monthnum'] ) || isset( $query_vars['day'] ) ) ) {
} elseif ( $postname_index && '%year%' === $permastructs[ $postname_index - 1 ] && ( isset( $query_vars['monthnum'] ) || isset( $query_vars['day'] ) ) ) {
$compare = 'monthnum';
} elseif ( '%monthnum%' === $permastructs[ $postname_index - 1 ] && isset( $query_vars['day'] ) ) {
} elseif ( $postname_index && '%monthnum%' === $permastructs[ $postname_index - 1 ] && isset( $query_vars['day'] ) ) {
$compare = 'day';
}

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.2-beta3-45213';
$wp_version = '5.2-beta3-45214';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.