Get image attachment ID’s
-
I am integrating categories and products from legacy system into WordPress / WooCommerce through WooCommerce REST API. The customer has a convention to determine categories / products images names. Therefore when I create a category / product into WooCommerce I need to determine if the image for that category / product is already uploaded to the media library of WordPress. If it has been uploaded then I need to grab the ID and attach it to the Json, otherwise I need to default to an existing image. The question is how can I search WordPress media library through REST API to verify if the image exist preferably without needing to install any plugin (I have used https://v2.wp-api.org/ but it breaks the integration code). Any other alternative?
Regards,
Mariano
- The topic ‘Get image attachment ID’s’ is closed to new replies.