Add support for 'url' to --porcelain to output the URL instead of attachment ID#182
Conversation
…tput ONLY the URL, instead of attachment ID or verbose descriptions.
Let's use |
…ge URLs being returned by `wp_get_attachment_url()`. Improved tests, including non-image file for thoroughness.
|
One more question before I commit the last fixes: What I've built here is an alternative to the One idea would be to allow the With With Does that make sense? Or should we limit this to be simply an alternative to the |
|
@justinmaurerdotdev I don't think we need to change the default output. However, I have a better idea for a flag: This is how it would work: We don't need to support all fields right now, but this approach gives us the flexibility to apply the pattern across other commands. |
|
OK, yeah. That's perfect! Will push those changes shortly. |
…the porcelain output to use additional fields. 'ID' (default) and 'url' currently supported.
--porcelain to output the URL instead of attachment ID
danielbachhuber
left a comment
There was a problem hiding this comment.
Great work on this! I made some minor stylistic changes with 0ca8360
|
Good deal. Changes look good. Thanks! |
This addresses #94
Should output ONLY the URL, instead of attachment ID or verbose descriptions.
Is that the best name for the flag?
Should we also provide an option for showing the URL in the verbose output?
Related wp-cli/wp-cli#5832