OSDN Git Service

Introduce system editor function in \WP_CLI\Utils
authorgoldenapples <goldenapplesdesign@gmail.com>
Fri, 8 Feb 2013 23:33:54 +0000 (15:33 -0800)
committergoldenapples <goldenapplesdesign@gmail.com>
Wed, 13 Feb 2013 07:51:21 +0000 (23:51 -0800)
commitbd0ad30c018b3f33ed9b7bb1f4eece7536a511ce
treef6b6ee6e14fd97416490e5ba75e801662ac2d983
parentcd8fd14b185b9c283085b35fdfbeb41b93cdb824
Introduce system editor function in \WP_CLI\Utils

Adds a function called `launch_editor_for_input()` which launches the
system's editor to allow file editing of post content, etc. Should
account for system line-endings properly, but probably needs testing on
Windows to be sure. Function returns false if no change (ie user :q!'s
out of vim), or updated content if any change is made.

Also adds two new subcommands to `wp post`:
- `wp post create --edit` Launches the editor to build the post
content before creating post.
- `wp post edit <id>` Edits post <id>'s content in system editor.
php/commands/post.php
php/utils.php