Create template as file is great. How to do that by dynamic function? What hook, function I need to add dynamic template to dropdown in page. If I won't have access to server files then I stuck - no template file can be provided without physical file.
Example here on old version here what works before update: https://wordpress.stackexchange.com/a/228763/114486
This work to part when I try to select new template from dropdown. It won't accept other than physical files so I stuck. Is there something that I missing from updates of WP?
Why not other logic? I use WP with REST API as a headless content. I added rest endpoint to get template as a logic to use proper template file on frontend. Use It as a version of frontend to choose and custom fields will be align to properly show page up