From 86ba6dc123dd39735e70a6e6ff50b1c39dd6717b Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 15 Sep 2016 07:47:32 +0200 Subject: [PATCH] Add "name" option for post titles --- src/shpub/Command/AbstractProps.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/shpub/Command/AbstractProps.php b/src/shpub/Command/AbstractProps.php index 6d7ef3b..b560fbe 100644 --- a/src/shpub/Command/AbstractProps.php +++ b/src/shpub/Command/AbstractProps.php @@ -40,6 +40,17 @@ class Command_AbstractProps 'default' => [], ) ); + $cmd->addOption( + 'name', + array( + 'short_name' => '-n', + 'long_name' => '--name', + 'description' => 'Post title', + 'help_name' => 'TITLE', + 'action' => 'StoreString', + 'default' => null, + ) + ); $cmd->addOption( 'published', array( @@ -98,6 +109,11 @@ class Command_AbstractProps 'category', $cmdRes->options['categories'] ); } + if ($cmdRes->options['name'] !== null) { + $req->req->addPostParameter( + 'name', $cmdRes->options['name'] + ); + } if ($cmdRes->options['slug'] !== null) { $req->req->addPostParameter( 'slug', $cmdRes->options['slug'] -- 2.30.2