I have a post type that has many posts with the same title with many to many relationships. When I use the connect existing post dialog in the admin side, I want to be able to display some post meta in the select options to be able to differentiate between the posts with the same name.
Currently users need to just trial and error and then use the connected post listing to try to see the post id. This is not ideal.
I acknowledge that this probably doesn't fall within the scope of "support", but if you could please point me to where these options are generated I can try to figure something out for myself.
I have looked in select2.js but I don't think this is where the options are being generated.
Thanks
Actually I sorted it by updating plugins\types\application\controllers\ajax\handler\related_content_action.php at around line 1000
// byetc edit - get code
$byetc_types = array( 'unit-of-competency', 'qualification', 'assessment-package');
$byetc_type = get_post_type( $post->get_id() );
if( in_array( $byetc_type, $byetc_types ) ){
$code = get_post_meta($post->get_id(), 'code', true).' - ';
$status = ' - '.get_post_meta($post->get_id(), 'status', true);
} else {$code='';}
$formatted_posts[] = array(
'id' => $post->get_id(),
'text' => $code . $post->get_title() . $status,
'disabled' => $disabled,
);
}