RichText Area
Textbox element for RichText content. This uses WordPress's wp_editor, which in turn uses the Tinymce editor.
Read View | Edit View |
---|---|
Constructor
/**
* @param $id
* @param string $label - the label of the element
* @param array $permissions - View, edit, read rights of the elemenet.
See WPooWPermissions in the Overview section.
*
**/
function __construct($id, $label, $permissions=[])
Usage example
// Declaring
$mySummaryDetails = new RichTextArea("_mySummary", "My Summary")
$bookReviewPostType->AddField($mySummaryDetails);
// Fetching Data
foreach ($bookReviewPostType->Query()->Select()->Fetch() as $row)
{
echo html_entity_decode(wpautop($row["_mySummary"]));
}
wpautop is a WordPress functions which changes double line-breaks in the text into HTML paragraphs (<p>...</p>
).
html_entity_decode convert all HTML entities to their applicable characters.