Add wp_get_theme_data_custom_templates#5031
Add wp_get_theme_data_custom_templates#5031oandregal wants to merge 4 commits intoWordPress:trunkfrom oandregal:add/public-method-for-custom-templates
wp_get_theme_data_custom_templates#5031Conversation
johnbillion
left a comment
There was a problem hiding this comment.
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_templatesto offer access to metadata stored undercustomTemplatesintheme.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