Sorry for taking so long to get back to this.
That shortcode doesn’t work, but I’m not getting any errors. Just nothing.
For the record, I worked around this problem in the following way:
I installed Advanced Custom Fields and created a field for this post type and one other post type called ‘utility’. I set the field to appear in a panel on the edit screen.
In functions.php I enqueued a script that loads into Admin using the hook for post edit screens only:
function my_load_scripts($hook) {
if( $hook != 'edit.php' && $hook != 'post.php' && $hook != 'post-new.php' )
return;
wp_enqueue_script( 'autofill-js', get_stylesheet_directory_uri() . '/js/autofill_fields.js', array('jquery'), '1.0.0', true );
}
add_action('admin_enqueue_scripts', 'my_load_scripts');
The script ‘autofill_fields.js’ contains the following, which can probably be done more efficiently than this:
jQuery(document).ready(function(){
// determine which post type we're dealing with by identifying which field is present
if (jQuery('#pe_theme_meta_info__position_').length > 0) {
var pval = jQuery('#pe_theme_meta_info__position_').val();
} else if (jQuery('#pe_theme_meta_info__type_').length > 0) {
var pval = jQuery('#pe_theme_meta_info__type_').val();
}
// now copy the value of the relevant field to my 'utility' field
jQuery('#acf-field-utility').val(pval);
// If the field changes, change 'utility' along with it
jQuery('#pe_theme_meta_info__position_').change(function(){
var pval = jQuery('#pe_theme_meta_info__position_').val();
jQuery('#acf-field-utility').val(pval);
});
// And this is the same for the other post type
jQuery('#pe_theme_meta_info__type_').change(function(){
var pval = jQuery('#pe_theme_meta_info__type_').val();
jQuery('#acf-field-utility').val(pval);
});
});
So now, whatever is in the Position field gets written to the utility field and I use
[field utility] to display that info.