Support the default_page_template_title
filter in page-attributes meta-box.
#6946
Labels
Backwards Compatibility
Issues or PRs that impact backwards compatability
[Feature] Extensibility
The ability to extend blocks or the editing experience
Milestone
Is your feature request related to a problem? Please describe.
It is not a given what
Default template
is for users of a WordPress website with themes that use multiple types of templates for layout.So since WP version
4.1.0
there have been a filter to change the name that appears in thepage-attributes
meta box:apply_filters( 'default_page_template_title', __( 'Default Template' ), 'meta-box' );
apply_filters( 'default_page_template_title', __( 'Default Template' ), 'quick-edit' );
This filter is currently not supported with Gutenberg since it is hardcoded in
editor/components/page-attributes/template.js
(at the time of writing it's on line 34).Describe the solution you'd like
I would like to be able to change the name of the default template (aka when there is no value). This could either be done with the existing
default_page_template_title
hook or a new solution.Describe alternatives you've considered
I have looked into how the templates are currently being fetched and this is being done with
wp_get_theme()->get_page_templates()
ingutenberg_editor_scripts_and_styles()
.An alternative to this solution would be to wrap the call in a PHP function and set all the values inside the PHP function and use the
default_page_template_title
filter for the default value.The text was updated successfully, but these errors were encountered: