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)?

4 s
4

There is a filter for this since version 4.1; cf. https://github.com/WordPress/WordPress/commit/7cdbac53e8497b346d1009375d36586fb6e5197c

You can now use:

add_filter('default_page_template_title', function() {
    return __('My default template name', 'your_text_domain');
});

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *