Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue replacing images #776

Open
mardelnet opened this issue Oct 28, 2024 · 0 comments
Open

Issue replacing images #776

mardelnet opened this issue Oct 28, 2024 · 0 comments

Comments

@mardelnet
Copy link

Hello everyone!
I am working on implementing a custom file replacement feature for my project.
So far, I can replace correctly both locally and in the Google Storage cloud any file except images.
When it comes to images, only the original file is replaced, but not the rest of the image sizes.
This is the piece of code I'm using to fire the replacement in Google Storage:

$attach_data = wp_generate_attachment_metadata($old_file_id, $old_file_path);
$post_meta_updated = wp_update_attachment_metadata($old_file_id, $attach_data);

Has anyone faced a similar situation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant