I am working on a client’s site and they need to select a Template whenever they are adding a new page; the “Default Template” is not a valid choice.
I would like to rename “Default Template” to something like “– Select Template –“.
Searching the WordPress codebase I found references to “Default Template” are hard-coded, in wp-admin/includes/meta-boxes.php (line 588) and wp-admin/includes/class-wp-posts-list-table.php (line 882). Does this mean there is currently no way to change this, without altering the core code (something I want to avoid)?
There is a filter for this since version 4.1; cf. https://github.com/WordPress/WordPress/commit/7cdbac53e8497b346d1009375d36586fb6e5197c
You can now use:
I agree with the answer that is given by @TravisPflanz but if you only want to change the name that is provided by the WordPress core you can use the following filter.
This replaces the default core translation with one of your own.
Please rename
yourprefix
andyour-theme-or-plugin-textdomain
to your configurationYour request, if I’m not mistaken, is to create an empty selection as the default for the page template drop-down, then force a user to select a custom page template.
This may be an over-simplified answer, but you should create a default template that is a valid choice, then offer other templates to supplement the “Default Template”. Just make default the most basic possible page layout. This will eliminate confusion for the user as well. Just determine which will be the most common page layout and make it the “Default”.
As Chip points out below, the “Default Template” always exists, even if you simply try to change the name using the traditional template naming methods. If you change the template name of page.php, you will simply be given the options of “Default Template” and the “New & Cool Page Template”.
I hit problems with using a new page.php in the child theme to define a different default template, so instead I using an
to setup a global option using
I then used
to delete the standard Page Attributes metabox that is used to define the Page Template and replace it with a copy of the code (see http://wpseek.com/page_attributes_meta_box/). I replaced the section of the code that finds the page template name with:
if no option is found $template is set to false, which makes the underlying code pick up the standard default template.