-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Add ability to duplicate CPTs & TAXs #760
Comments
I believe renaming the slug without doing a content migration works for this. Not so much an advertised feature, but more a happenstance one. Happens because the part we do any checks/comparisons against gets edited so it assumes it's a brand new one and happily saves. |
I just accidentally did this. Yes, not checking migrate will dupe it to a new name. |
Thansk Michael, I think it would be useful to expose this as a feature on the checkbox so users have the information available. Adding PR |
Hey @garretthyder still open to accepting in a PR for this. Ready whenever you are. |
I will try to create an PR for this. I'll try to do something like the current Populate additional labels based on chosen labels Button, with JS. Maybe an select that you choose the tax/cpt you want to dup, then download with AJAX the fields for it and fill the form with them. What do you think? |
I'm open to see what you come up with, and let you explore potential ideas. :) I do know I've generally shied away from adding AJAX based functionality to CPTUI, but that's also in large part because I had not yet had a reason to make use of AJAX yet either. That said, as I sit here and think about it, if I were taking this on myself at the moment, I'd probably add a checkbox below the "migrate posts" and "migrate terms" checkboxes. Then, if checked, also show a new text field for the new slug to use. That way, one could simply hit save, let things refresh, and if we have the checkbox and new slug, pass those along to the save/update functions. Very likely a case of grabbing the currently edited content type slug, and the matching saved from our options setting, based on that slug, replace the index name with the chosen replacement, and then re-updating the option. I hope that makes some sense. Things to keep in mind here
Stuff to consider, and it's not a method/way that you MUST do things. |
@garretthyder Curious on some thoughts from you. Where would the UI for this be at, ideally from user experience POV? when editing a given post type/taxonomy? or perhaps in our little table area in Also would it be a case of just refresh the page with the newly duplicated item listed with the rest? or would it take you directly to editing the newly created type/tax? Perhaps with the slug value empty and to be filled in? I'm kind of leaning towards the duplicate link being in the listing, and the user redirected to edit that newly created item and no slug filled in by default, but the rest would be. |
Hello,
I was going to create a second taxonomy for a CPT that was identical to another aside from it's name...
It would be really nice to have a Duplicate feature in CPTUI so you can create a new CPT or TAX from a pre-existing one to speed of your development flow.
I hope that makes sense,
Cheers
The text was updated successfully, but these errors were encountered: