I need to insert in a custom post a checkbox field. This checkbox must show a list of title of another custom post so I cannot insert the values in the "Choices" filed, I need a function to compile it dynamically.
I've partially solved the problem with "Export Field Groups to PHP". In the function.php I have a query that compile an array with the title of the custom post I need, the in the array() of the checbox I put a list of variable:
array ( 'label' => 'Name of Field', ... 'choices' => array ( $value, $value, ... $value, ), ... ),
But the number of the values in the arry() are fixed, so if you insert a new post in the custom post this is not show in the checkbox.