summaryrefslogtreecommitdiff
path: root/controllers/editor.php
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2017-01-04 15:26:51 -0800
committerAaron Parecki <aaron@parecki.com>2017-01-04 15:26:51 -0800
commitacafb9192a6402a3f3d60d5e6af11cb4576fc96c (patch)
treed70737a0ee528cff04673ff6b66a1667fbd302bf /controllers/editor.php
parente7fe68f73e441778f80683383ddb2ffe7a48f85c (diff)
add tags, slug and status field to quill editor
Diffstat (limited to 'controllers/editor.php')
-rw-r--r--controllers/editor.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/controllers/editor.php b/controllers/editor.php
index 3818328..0f4380b 100644
--- a/controllers/editor.php
+++ b/controllers/editor.php
@@ -25,6 +25,17 @@ $app->post('/editor/publish', function() use($app) {
'content' => $content
);
+ if(array_key_exists('category', $params) && $params['category'])
+ $micropub_request['category'] = $params['category'];
+
+ if(array_key_exists('slug', $params) && $params['slug'])
+ $micropub_request[$user->micropub_slug_field] = $params['slug'];
+
+ if(array_key_exists('status', $params) && $params['status']) {
+ if($params['status'] == 'draft')
+ $micropub_request['post-status'] = $params['status'];
+ }
+
$r = micropub_post_for_user($user, $micropub_request);
$app->response()['Content-type'] = 'application/json';