I am creating a page using the
wp_insert_code the page is being created just find.
I want to choose a default template for the page I am creating which the template is inside plugin folder in a templates folder.
I tried to use this code:
update_post_meta($post_id, '_wp_page_template', $page_template_path);
It does work when ever a template in defined inside the theme directory but I want to have templates files inside plugin folder.
To make my plugin reusable and easy to setup. Can you help me figure that out?