Add support for the default_page_template_title
filter in page-attributes meta-box.
#6948
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I have wrapped the
availableTemplates
call towp_get_theme()->get_page_templates(...)
in a PHP function to directly add the default template into the array so we can use the already existingdefault_page_template_title
filter instead of hardcoding it in theeditor/components/page-attributes/template.js
file.More about the reasoning can be found in #6946
Fixes #6946
How has this been tested?
The change is very isolated and will only have any effect on the
page-attributes
meta box. I have run manual testing by testing the following scenarios:The environment was a clean vanilla install of WordPress 4.9.6 with Twentysixteen 1.5 run on a custom Docker installation (PHP 7.1 / Apache 2.4) with a manually run
npm install
andnpm run dev
.Types of changes
Added new functionality to support already existing functionality in WordPress.
Checklist: