Upload images gallery to wordpress with python-wordpress-xmlrpc -


okay have created script in python using "python-wordpress-xmlrpc" package able except uploading multiple images wordpress , adding them gallery.

here code upload single image file , set feature image:

fileimg = urlopen('image_url') imagename = fileimg.url.split('/')[-1] imagetype = mimetypes.guess_type(str(fileimg.url))[0]  data = {     'name': imagename,     'type': imagetype, }  data['bits'] = xmlrpc_client.binary(fileimg.read())  response = client.call(media.uploadfile(data)) attachment_id = response['id'] widget.thumbnail = attachment_id 

note: know how upload multiple files don't understand how add images in product gallery.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -