I have a workaround for you that already might work for you.
You could add a custom field column and look for the custom field ‘_views_template’.
This custom fields contains the ID of the related view (template) for that post.
You can enable inline edit and leave the rest of the settings as is.
I wrote two hooks for you that you can put in your theme or custom code plugin.
1) The first hook allows you to inline edit the column and select the view for your post. You might want to tweak it some more because it now allows you to set any view instead of only the view for that post type you’re on. I did not dive into the API yet, but I suspect they have a nice API call for that.
2) The second hook will alter the value (which is an ID by default) and transform it into the template name (post type). I hope this will help you get this feature already in place for your environment.
/**
* @param array $settings
* @param AC\Column $column
*/
function acp_editing_set_views_templates( $settings, $column ) {
if ( $column instanceof AC\Column\CustomField && $column->get_meta_key() === '_views_template' ) {
$all_templates = get_posts(array(
'post_type' => 'view-template',
'posts_per_page' => -1,
'fields' => 'ids'
));
foreach( $all_templates as $template_id ){
$settings['options'][ $template_id ] = get_the_title( $template_id );
}
$settings['type'] = 'select';
}
return $settings;
}
add_action( 'acp/editing/view_settings', 'acp_editing_set_views_templates', 10, 2 );
/**
* @param string $value
* @param int $id
* @param AC\Column $column
*
* @return string
*/
function ac_display_template_title( $value, $id, $column ) {
if ( $column instanceof AC\Column\CustomField && $column->get_meta_key() === '_views_template' ) {
$value = get_the_title( $value );
}
return $value;
}
add_action( 'ac/column/value', 'ac_display_template_title', 10, 3 );