Well, I did find the following simple plugin: https://wordpress.org/plugins/post-type-switcher/
That one could do the job, but it would be nicer to have some ‘switch’ in Entries, to bring an entry over to the wished CPT.
Any ideas?
Hi Peter, glad you reached out!
I have been thinking of adding this functionality to the plugin but it’s not yet there. You are unfortunately going to have to create a post with your custom post type and add the field values programmatically.
You could use the plugin code as a reference, I do something similar when creating the entries! Check out this file: https://github.com/advancedforms/advanced-forms/blob/master/core/core-entries.php
The function create_entry generates an entry on form submission and adds all fields values with a loop like this:
// Transfer all fields to the entry
foreach ( $fields as $field ) {
update_field( $field['key'], $field['_input'], $entry_id );
}
Hope this helped you out!