-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add wp_get_theme_data_custom_templates
#5031
Add wp_get_theme_data_custom_templates
#5031
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is missing a return
statement and its @return
tag is incorrect. Can you check and correct those please?
Thanks, @johnbillion for catching the issue. Both things addressed. |
Ah correct. |
Added the line break as well. |
Looking for how we do |
@johnbillion when you have the time, can you clear up the blocker so I can commit this? |
Committed at https://core.trac.wordpress.org/changeset/56413. |
Part of WordPress/gutenberg#45171
Trac ticket: https://core.trac.wordpress.org/ticket/59137
What
This PR adds a new public function
wp_get_theme_data_custom_templates
to offer access to metadata stored undercustomTemplates
intheme.json
.Why
There is a no public function to get access to that data, so consumers need to resort to private APIs. This follows the steps of
wp_get_global_settings
,wp_theme_has_theme_json
,wp_get_theme_directory_pattern_slugs
, andwp_get_theme_data_template_parts
.How
It creates a new function that uses the private calls and substitutes all the instances of the old one in the codebase.
How to test
TBD.
Commit message