bobbingwide / oik-clone

Clone content between sites
https://www.oik-plugins.com/oik-plugins/oik-clone-clone-your-wordpress-content/
GNU General Public License v2.0
5 stars 0 forks source link

Stick to the top of the blog option not being cloned correctly? #35

Open bobbingwide opened 5 years ago

bobbingwide commented 5 years ago

When I update and cloned to https://core.wp-a2z.org/2019/01/12/blocks-catalog/ the value of the Stick to the top of the blog field was not correctly populated.

Why not?

Expected result

I'd update the source post and unticked the checkbox, so in the cloned target the checkbox should no longer be ticked.

Actual result

image

Workaround

Update the cloned version.

bobbingwide commented 5 years ago

The simple explanation for this issue is that the data is stored in the wp_options table under a key of sticky_posts. It's a serialised array. e.g. a:1:{i:0;i:3254;}. If you want to change the sticky posts then it's the options that will need to be cloned.

bobbingwide commented 5 years ago

Proposed solution

Develop cloning logic for the options table. It should ignore transients, and certain fields that we honestly do expect to be different such as homeurl and siteurl. Any IDs found in serialised options would need to be mapped the same way as for post meta data.