Hi,
My customer is working on inputting data and I had created 2 custom post types for him. He mistakenly entered some of them in the wrong post type and I want to change them to the other post type.
Post type A has X number of custom fields. This is the one he accidentally used for some posts that should be Post type B.
Post type B has the same fields as post type A (exact same fields) plus some additional fields not in A. So if I changed them from A to B, all the data would go to the correct fields since all fields in A exist in B.
I understand there is no way to do this in Types. I also understand that a plugin called post type switcher doesn't work correctly either. I'm wondering if there is a way to do this in phpmyadmin so my customer doesn't have to re-enter all that data. (it's quite a bit of work.)
It is as simple as changing the post_type in the wp_posts table if you dont have WPML enabled.
Also, we implemented a fix for "Post Type Switcher" so it should be working. However, it would a good idea to make a backup just in case.
Ok, I installed the Post Type Switcher plugin then, and it worked to switch post types. However, it also caused a problem. The 2 parent post types I need to be able to switch are basic listings and full listings.
There are child post types (associated with both) that are called scorecards and galleries.
For some reason, just changing the post type loses the already entered data for scorecards and galleries. Why would that happen? Aren't the field tables looking at the post ID which didn't change when switching the post type of the parent?
I think this may happen because of the way "Post Type Switcher" works.
Did you try changing the value of the post_type field directly in the wp_posts table?
No because you told me that you had made some changes that meant the post type switcher plugin would work correctly.
But something worse it happening here. Go to the WP admin and go to add new under basic listings. Make a fake listing. after you save, you can then add the fields table for scorecards (the child post type) to that golf course. But after you add them and save, then go back to the course, the entered data doesn't display anymore.
I don't know what's going on. It's really screwing up my development on this site. Please help! 🙁
We added a workaround in our plugins to work well with the post type switcher plugin.
The problem was detected and fixed for single posts, but I don't think we ever noticed the problem with parent/child posts.
We already have a report about this problem and we are still waiting for developers feedback on this:
https://toolset.com/forums/topic/updating-parent-destroys-child-in-many-many-post-relationship/
I have taken a note of this thread and we will get back to you when we have more information.
Are you able to edit the wp_posts table directly in the mean time?
Regards
Caridad