Document API
This article is a guide instructing you how to get started integrating through the Document API.
Rendering Documents
cs_render_document_html
@since Cornerstone 7.5.0
cs_render_document_html
takes in a Post ID or Document ID and renders the elements in that Document into HTML. This can be useful for integrating into plugins that read HTML.
$postID = 123;
$html = cs_render_document_html($postID);
cs_render_document_html_with_comment
@since Cornerstone 7.6.0
This is identical to cs_render_document_html
however it will create a special comment which will trigger the render of the elements for a post when run through the filter the_content
. This is how the content storage mode for HTML works.
$postID = 123;
$html = cs_render_document_html_with_comment($postID);
See something inaccurate? Let us know