summaryrefslogtreecommitdiff
path: root/controllers/editor.php
diff options
context:
space:
mode:
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';