In WooCommerce CLI, how can I add an audio file for download?
-
Looking at the API here, most attributes of a product seem be settable. Right now I have something along the lines of:
wp wc product create --title=boat --downloadable=true --virtual=true --sold_individually=true --in_stock=true --description="Salem has fleas" --regular_price=0.99 --type=simple --enable_html_description=true --short_description=fun --enable_html_short_description=true --reviews_allowed=true --download_type=music
I need to actually get the audio file in there. Part of the problem is, I don’t know how to input arrays. What I can say, is this is what a query looks like when an audio file exists in a product:
[boat@programming public_html]$ wp wc product get 205 --field=downloads
PHP Notice: Constant WP_DEBUG already defined in phar:///srv/boat/public_html/wp-cli.phar/php/WP_CLI/Runner.php(981) : eval()'d code on line 91
[{"id":"25e5d9db7e007fac9ae36bcc9d88feb2","name":"Andy.ogg","file":"http:\/\/something.org\/wp-content\/uploads\/2016\/12\/Andy.ogg"}]So if I were to make a new product, what would the field look like if I were to add “Andy.ogg” to it?
Thanks.
- The topic ‘In WooCommerce CLI, how can I add an audio file for download?’ is closed to new replies.