From acafb9192a6402a3f3d60d5e6af11cb4576fc96c Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Wed, 4 Jan 2017 15:26:51 -0800 Subject: add tags, slug and status field to quill editor --- controllers/editor.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'controllers/editor.php') 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'; -- cgit v1.2.3