Skip to main content

onPostPublish

Callback to receive the data published from the editor.

Usage

predis.createPost({
onPostPublish: function (error, data) {
console.log(error, data);
},
});

Parameters

NameDescriptionTypeRequired
errorError triggered when the post failed to publish otherwise nullErroryes
dataThe data of the published post inthe format given below.Objectyes
data.media_urlAn array containing URL(s) of the published media. This can be a URL for a jpeg or mp4 file.
In case when data.media_type is single_image or video the array will contain only one item, while in case of carousel it can contain multiple items.
Arrayyes
data.post_idAn unique ID to identify the published post.Stringyes
data.thumb_urlAn URL for the thumbnail of the published media.Stringyes
data.media_typeMedia type of the published media. Can be one of single_image, carousel or videoStringyes
data.captionCaption of the generated content.Stringyes