Airship\Cabin\Bridge\Landing\Blog::processNewPost PHP Method

processNewPost() protected method

Create a new blog post
protected processNewPost ( array $post, array $authorsAllowed = [] ) : boolean
$post array
$authorsAllowed array
return boolean
    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);
    }