Returns the metadata for the custom templates defined by the theme via theme.json.
$template_name => $template_data pairs, with $template_data having "title" and "postTypes" fields.function wp_get_theme_data_custom_templates() {
return WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) )->get_custom_templates();
}
| Version | Description |
|---|---|
| 6.4.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_get_theme_data_custom_templates