Skip to content

Commit 7a840d3

Browse files
committed
Template activation: fix unique slug filtering.
The logic introduced for the unique slug filter in [61033] is incorrect. We should return the desired slug for the `wp_template` post type. This causes any second created template targeting a certain slug to not work correctly. Developed in #10397. See #62755. Fixes #64141. Props ntsekouras, priethor. git-svn-id: https://develop.svn.wordpress.org/trunk@61054 602fd350-edb4-49c9-b593-d223f7449a82
1 parent aae3ac3 commit 7a840d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wp-includes/theme-templates.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ function wp_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_id
5050
}
5151

5252
// For wp_template, slugs no longer have to be unique within the same theme.
53-
if ( 'wp_template' !== $post_type ) {
54-
return $override_slug;
53+
if ( 'wp_template' === $post_type ) {
54+
return $slug;
5555
}
5656

5757
if ( ! $override_slug ) {

0 commit comments

Comments
 (0)