-
Notifications
You must be signed in to change notification settings - Fork 114
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
[Media] Migrate WPCom media upload to /wp/v2 endpoints #14537
Conversation
📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with simulator iPhone 16 Pro iOS 18.0 and confirmed that uploading images works for sites (non-JP, JCP, or JP sites) without XMLRPC ✅
func uploadMedia(siteID: Int64, | ||
productID: Int64, | ||
mediaItem: UploadableMedia, | ||
completion: @escaping (Result<WordPressMedia, Error>) -> Void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nit: indentation needs to be updated here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Done in de07dbd
Closes: #14232
Description
This PR updates the handling of the media operations (upload and fetch) to the user the /wp/v2 endpoints instead of the legacy /v1.1 ones, this is needed to fix upload problems for sites with XMLRPC issues.
Changes
Steps to reproduce
a. No Jetpack case (Application Password)
b. Jetpack CP site case
wp-admin
page)c. WordPress.com / full Jetpack site case
Testing information
Screenshots
Simulator.Screen.Recording.-.iPhone.16.-.2024-11-27.at.21.57.32.mp4
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: