Make WordPress Core

Opened 12 years ago

Closed 10 years ago

#22145 closed enhancement (wontfix)

Add warning when duplicate page Template Names are present

Reported by: johncoswell's profile johncoswell Owned by:
Milestone: Priority: normal
Severity: trivial Version:
Component: Themes Keywords:
Focuses: template Cc:

Description

Currently, there's no way without searching through every template file whether or not you have a duplicate Template Name (from, say, copying a page template file to another one). It would be nice to have a warning in the Page Template selection area that you have duplicate Template Names in certain files, and to direct you to repair that error before you proceed with setting Page Templates.

Change History (5)

#1 @SergeyBiryukov
12 years ago

  • Component changed from Editor to Template

#2 @nacin
11 years ago

  • Component changed from Template to Themes
  • Focuses template added

#3 follow-up: @RDall
11 years ago

While I do like this idea aren't most themes are produced by people with FTP/SSH access. Wouldn't they see the template names in the list of templates file before they went into set the template in the page editor.

We would also give the user control to change file names which might be too much control for the user IMHO.

#4 in reply to: ↑ 3 @terminalpixel
10 years ago

Replying to RDall:

They would see the PHP file names not the template name which is included in a comment in a file.

But I agree this would mainly be for developers so perhaps it could check for WP_DEBUG being set.

While I do like this idea aren't most themes are produced by people with FTP/SSH access. Wouldn't they see the template names in the list of templates file before they went into set the template in the page editor.

We would also give the user control to change file names which might be too much control for the user IMHO.

#5 @obenland
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

This sounds like an edge case situation, the overwhelming majority of themes probably doesn't have more than a handful of page templates, if any.

I'd consider it plugin territory since it's a debug notification used during development, and not intended for users. Maybe it could be part of Theme Check.

Note: See TracTickets for help on using tickets.