Tell us what you are trying to do?
retrieve the content from a WYSIWYG field of a related post(1 capture) and put the retrieved content in a field of a new post(2 capture).
Is there any documentation that you are following?
nop, I didn't found information
Is there a similar example that we can see?
Fill a WYSIWYG field with a data from a field from a related post, selected with a dropdown.
I'll try to explain me better:
When I edit a post type A, there are a field to select a refered post (type B). Then, I want to copy the content of a field from the selected refered post to put this content in a field of the post I'm editing.
Thank you for the clarity however any copying of field data from another post into your current post will require custom code to achieve or you manually copy and paste the data in.
As mentioned the custom code required for this would be out of the scope of our support forum as we will first need to retrieve the post that was selected and then insert that data into the post being edited and that will need to be done once an action is triggered on the post edit screen such as the when the post is created or when the update button is clicked.
Hi Shane,
I undertand. Then, to find an alternative solution to my problem: Is there some way to retrieve the related post's URL, one time the update button has been clicked to save the related post selected? My intention is put a link to the related post to facilitate the copy of data.
Shane is on vacation. This is Minesh here and I'll take care of this ticket. Hope this is ok.
Can you please tell me you want to copy the content while you edit the post in backend?
If yes, there is no such feature exists and it will require custom programming that is beyond the scope of our support policy. If you wan custom programming for your project you are welcome to contact our certified partners:
- https://toolset.com/contractors/
Hi Minesh,
I'm looking for an alternative solution.
Instead copy content from a related post, a solution could be put the link to the related post, to wordpress admin or single page, in the edit post page and the user will copy manually the content.
Do you want this or you still have other ideas, if thats the case, can you please explain the whole flow user will have to follow from start to end to copy your content. Do you want to allow user to copy content from backend or using Toolset form?
Hi Minesh,
I want when a user is editing a post, like shown at attached screenshot, and select a post reference (1 in screenshot) , the field WYSIWYG (2 in screenshot) is filled with the content from a WYSIWYG field from referenced post in 1.
Ok, your requirement is clear but there is no such feature exists as of now to copy the post content to another field on select of post reference field option.
What you can do is, you can use the save_post hook and based on the post reference field value, you can get the ID of post and get the content of the post that is saved with post reference field and then copy the content to your desired field.
Please let me know if you require any help with that and for that please share admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I've created the following post and I can see the parent custom post field value is copy successfully to the new post:
=> hidden link
Important Note:
- Please note that you will have to use classic editor to add/edit posts for post type "cpt2" as with block editor will not work as expected.