• Resolved delanthear

    (@delanthear)


    Hi!

    I’m currently using Toolset Types and have a bunch of different post types set up. I’m trying to work out how I can create posts by duplicating from a library of predefined posts. I.e. I select a post from a drop down list of previous created “templates” types duplicate it as a different post type. As an example, There are predesigned workout exercises (Squats, Plank, Burpees for example) as templates and I duplicate the Squat template as an “exercise” post type and add additional info like numbers of reps and sets.

    Can you use the API and the “duplicate_post_pre_copy” action to mean that the duplicate that is made is actually as a different post type to the original?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Michael Ti?a

    (@mikes41720)

    Hi @delanthear

    We understand you are using Toolset Types and would like to duplicate from a library of predefined posts and duplicate it as a different post type.

    Unfortunately, this is outside our scope of support, but we would like to refer you to the developer documentation on the Yoast Duplicate Post plugin, for the available set of filters and actions, functions, and template tags, in order to modify the plugin in any way to better suit your needs – https://developer.yoast.com/duplicate-post/overview

    Thread Starter delanthear

    (@delanthear)

    Hi, I eventually worked out how to use duplicate_post_create_duplicate() to do this. I posted this after looking at the documentation because the docs on duplicate_post_pre_copy really wasn’t clear about how you could use it. It could do with more info on there and some some examples!

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi @delanthear

    We’re glad to hear you were able to get it working! We’ve taken your feedback into consideration in further improving the developer documentation to add more information and possibly add some examples. Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Duplicate as different post type via API’ is closed to new replies.