Airship\Cabin\Bridge\Landing\Blog::processNewPost PHP Метод

processNewPost() защищенный Метод

Create a new blog post
protected processNewPost ( array $post, array $authorsAllowed = [] ) : boolean
$post array
$authorsAllowed array
Результат 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);
    }