drdavidc
Forum Replies Created
-
I’ve experienced this problem when setting the expiration time creating a new post. I need to exit the block editor back to the posts list. Then going back into the block editor and setting the expiration time does work. As above, setting expiration time via Quick Edit also works.
I’ve noticed that there is no cron entry created when it doesn’t work.
Hope that helps.
Another quick and useful reply. Thanks Jose.
I’m quite new to WordPress so I didn’t know about editing custom fields. Your suggestion works nicely but care is needed. So, the following method of copying a desktop/mobile pair does work:
- Clone the desktop page and note the new post number by pointing at the Edit link of the clone
- Clone its mobile page and note the new post number by pointing at the Edit link of the cloned mobile page
- Edit the desktop page and update eos_scfm_mobile_post_id to the value of the cloned mobile page. Use the update button for the custom field but do not publish or save the draft. Return to the pages list without saving.
- Edit the mobile page and update eos_scfm_desktop_post_id to the value of the cloned desktop page and eos_scfm_mobile_post_id to the value of the cloned mobile page (i.e. the one you’re editing). Use the update button for the custom fields but do not publish or save the draft. Return to the pages list without saving.
If you publish or save the draft before returning to the pages list, your code seems to detect the change of the custom fields and chases the old links to “fix” their target, which then breaks the originals.
To copy just the desktop version, clone it as before and edit it to delete eos_scfm_mobile_post_id, returning to the pages list without saving it.
The key thing is not to allow your link chasing code to execute and break the original(s).
Hope that makes sense.
Thanks Jose for the quick and helpful response. I forgot to say in my original post what a useful plugin this is and it’s working well for me. So thanks for your hard work.
Yoast Duplicate Post does allow metadata to be filtered with a comma separated list of exclusions, so your solution of setting the filter works nicely to allow a post with a mobile version to be copied without linking back incorrectly. This is a reliable way of working, but requires a new mobile version of the copied post to be created from the desktop copy. If I copy the mobile version as well, there’s no way I can see to link the two copies.
If I remove the metadata filters and copy both parts of the original post, those copied parts link back to their originals. If I try to edit the link of either in their respective editing pages, it breaks the pairing of the original post and its mobile version. Your code must be chasing the old value of the link being updated to fix the other end of it – this is probably the right thing to do in more “normal” circumstances.
Given what you said about those two metadata fields, I’ve managed to correct the links between copies of the desktop and mobile versions in the database using PhpMyAdmin. This isn’t practical in general use, but it was useful to understand how things work.
What would be useful would be the means to select two separate posts and tie them together as a desktop/mobile pair. At the moment, a non-paired post has only the “Create Mobile Version” button in the Mobile Version panel on its editing page. The possibility also of pairing with an existing post would be useful and would provide a solution to copying desktop/mobile pairs (provided the metadata filter was used during the copy).