public function add($postData, $fileKey = false)
    {
        // Set the post type
        $postData['post_type'] = $this->postType;
        // Insert the post and return the response
        $newPostId = WP::wpInsertPost($postData);
        // If the new post was added successfully
        if ($newPostId && !WP::isWpError($newPostId)) {
            // If the file is uploaded
            if (is_uploaded_file($_FILES[$fileKey]['tmp_name'])) {
                require_once(ABSPATH . 'wp-admin/includes/image.php');
                require_once(ABSPATH . 'wp-admin/includes/file.php');
                require_once(ABSPATH . 'wp-admin/includes/media.php');
                // Upload the file
                $attachmentId = WP::mediaHandleUpload($fileKey, $newPostId);
                // If the attachment is valid
                if ($attachmentId && !WP::isWpError($attachmentId)) {
                    // Set the post thumbnail
                    WP::setPostThumbnail($newPostId, $attachmentId);
                }
            }
        }
        return $newPostId;
    }