I have a page template and bound some custom fields to it. I want to use with no other page template. The way I do this is:
$fields[] = [
'title' => __('my_title', NAME_SPACE),
'id' => PREFIX . 'my_id',
'post_types' => ['page'],
'include' => [
'relation' => 'AND',
'template' => ['template-my_template.php'],
],
'context' => 'normal',
'style' => 'default',
'fields' => [$my_fields_here]
However, these fields will only show if I save the page with the template selected and reload it. This is very unintuitive. Could this be solved so the fields will show up as soon as the template is selected?