• Resolved ventio

    (@ventio)


    Can I use a parameter from the url to transfer the value to a new cloned post?

    I will show you what I mean with an example:

    1. I open the page I want to clone with an additional parameter
      https://your-domain.com/page1/?parameter1=value1&parameter2=value2
    2. I click on “Duplicate Post New Draft” and at this point it is cloned to the draft page along with parameter1 and parameter2 where the values ​​of these parameters are saved to the appropriate Fields

    Is there any way to copy parameters from the url to use the values ​​when copying?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi @ventio

    Are you trying to use the parameters in URL because you would like to transfer few specific value from the original to the duplicated post?

    If yes, there is a setting from WordPress dashboard > Settings > Duplicate post > Duplicate Post Options > What to copy > Post/page elements to copy and there you can select the data that you would like to copy.

    Kindly let me know if I am not picking up the question correctly.

    Thread Starter ventio

    (@ventio)

    I’m sorry but I don’t understand… What exactly should I select in these settings if I want to transfer parameters from the URL to the appropriate fields?

    Hi @ventio

    Thanks for the response and I am sorry for the confusion.

    In my previous answer, I was informing how you can transfer the value from one post to another post from our settings.

    May I know a little more on what you are trying to achieve by passing the value through URL parameters?

    Thread Starter ventio

    (@ventio)

    Let me show you what I mean with an example:

    1. I open the page that I want to clone, an example url of such a page is: https://your-domain.com/page1/?parameter1=value1&parameter2=value2 (Pay attention to this url. In the url there is parameter1=value1 and parameter2=value2)
    2. I would like it to be cloned to the draft page along with parameter 1 and parameter 2 after clicking “Duplicate post, new draft”, where the values ​​of these parameters are saved in the appropriate fields

    Is there a way to copy parameters from a URL?

    Hi @ventio

    This will require custom code to copy parameters from URL and pass the value of the parameter. You can check the filters to customize as required.

    Thread Starter ventio

    (@ventio)

    Ok, which filter should I pay attention to?

    Hi @ventio

    You can try the dp_duplicate_post and dp_duplicate_page actions.

    This thread was marked resolved due to a lack of recent activity. The original poster can change the status to Not Resolved to re-open the issue or open a new topic.

    If you are not the original poster but have a similar issue, please open a new topic.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Using the value from the url parameter when cloning’ is closed to new replies.