taotoo Posted November 12, 2022 Share Posted November 12, 2022 I'm using a hook (similar to @bernhard's below) to add a Clone button when editing pages. Is it possible to clone the page, but without also copying over the image files? I tried adding this code towards the end of the hook: $clone->image = null; $clone->save(); This successfully prevents the contents of the image field being cloned, but PW still copies the image files themselves into the new page's directory. I also looked at the API documentation, but it doesn't seem to provide an option for this. I want to avoid copying the images as there are typically about 20 files that get copied, which takes about 10 seconds on the shared server. Additionally, the first thing the client will do after cloning the page is delete the images as they will be unneeded. Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now