diff --git a/src/wp-includes/theme-templates.php b/src/wp-includes/theme-templates.php index 7ebc3cdc1a793..f31cacd39ab1a 100644 --- a/src/wp-includes/theme-templates.php +++ b/src/wp-includes/theme-templates.php @@ -50,8 +50,8 @@ function wp_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_id } // For wp_template, slugs no longer have to be unique within the same theme. - if ( 'wp_template' !== $post_type ) { - return $override_slug; + if ( 'wp_template' === $post_type ) { + return $slug; } if ( ! $override_slug ) {