Make WordPress Core

Changeset 61054


Ignore:
Timestamp:
10/23/2025 02:58:23 PM (4 months ago)
Author:
ellatrix
Message:

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 https://github.com/WordPress/wordpress-develop/pull/10397.

See #62755.
Fixes #64141.
Props ntsekouras, priethor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/theme-templates.php

    r61029 r61054  
    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
Note: See TracChangeset for help on using the changeset viewer.