wp-papi / papi

:rocket: WordPress Page Type API with custom fields
https://wp-papi.github.io
MIT License
263 stars 32 forks source link

Make use of page templates dropdown #258

Closed frozzare closed 5 years ago

frozzare commented 6 years ago

Right now we remove [Page Templates]() dropdown since we don't use it. But after some thinking we should be able to use it since we introduce new template arrays with label and template for module property in #254 (example)

So we have label and value for the page templates dropdown and we know which post type it is and according to the WordPress documentation we should be able to use hooks here to inject our custom templates. Looks like a key value array that are return by get_page_templates function on WP_Theme class.

And when more than one template is used we should show page templates dropdown by default instead of removing it as we do now.