回答:
get_page_template()page_templateフィルタを介してオーバーライドできます。プラグインがテンプレートとしてファイルを含むディレクトリである場合、これらのファイルの名前を渡すだけです。「オンザフライ」で作成したい場合(管理エリアで編集してデータベースに保存しますか?)、キャッシュディレクトリに書き込んで参照したり、フックしtemplate_redirectて何かおかしなeval()ことをしたりできます。。
特定の基準が当てはまる場合、同じプラグインディレクトリ内のファイルに「リダイレクト」するプラグインの簡単な例:
add_filter( 'page_template', 'wpa3396_page_template' );
function wpa3396_page_template( $page_template )
{
    if ( is_page( 'my-custom-page-slug' ) ) {
        $page_template = dirname( __FILE__ ) . '/custom-page-template.php';
    }
    return $page_template;
}
オーバーライドget_page_template()は簡単なハックです。管理画面からテンプレートを選択することは許可されておらず、ページスラッグはプラグインにハードコードされているため、ユーザーはテンプレートがどこから来たのか知ることができません。
好適な解決策は従うことになり、このチュートリアルで使用すると、プラグインからバックエンドでページテンプレートを登録することができます。その後、他のテンプレートと同様に機能します。
 /*
 * Initializes the plugin by setting filters and administration functions.
 */
private function __construct() {
        $this->templates = array();
        // Add a filter to the attributes metabox to inject template into the cache.
        add_filter('page_attributes_dropdown_pages_args',
            array( $this, 'register_project_templates' ) 
        );
        // Add a filter to the save post to inject out template into the page cache
        add_filter('wp_insert_post_data', 
            array( $this, 'register_project_templates' ) 
        );
        // Add a filter to the template include to determine if the page has our 
        // template assigned and return it's path
        add_filter('template_include', 
            array( $this, 'view_project_template') 
        );
        // Add your templates to this array.
        $this->templates = array(
                'goodtobebad-template.php'     => 'It\'s Good to Be Bad',
        );
}
これまでの答えはどれも私のものではありませんでした。ここで、Wordpress adminでテンプレートを選択できます。メインのphpプラグインファイルに配置template-configurator.phpし、テンプレート名で変更するだけです
//Load template from specific page
add_filter( 'page_template', 'wpa3396_page_template' );
function wpa3396_page_template( $page_template ){
    if ( get_page_template_slug() == 'template-configurator.php' ) {
        $page_template = dirname( __FILE__ ) . '/template-configurator.php';
    }
    return $page_template;
}
/**
 * Add "Custom" template to page attirbute template section.
 */
add_filter( 'theme_page_templates', 'wpse_288589_add_template_to_select', 10, 4 );
function wpse_288589_add_template_to_select( $post_templates, $wp_theme, $post, $post_type ) {
    // Add custom template named template-custom.php to select dropdown 
    $post_templates['template-configurator.php'] = __('Configurator');
    return $post_templates;
}