protected function processNewPost(array $post, array $authorsAllowed = []) : bool { $required = ['author', 'blog_post_body', 'format', 'save_btn', 'title']; if (!\Airship\all_keys_exist($required, $post)) { return false; } if (!\in_array($post['author'], $authorsAllowed)) { return false; } $publish = $this->can('publish') ? $post['save_btn'] === 'publish' : false; return $this->blog->createPost($post, $publish); }