Editor Control
The editor control provides the default WordPress editor. To directly edit content in the builder preview set the inlineEditing properties. See the code example below:
class Prefix_Element_Editor extends \Bricks\Element { // Set builder controls public function set_controls() { $this->controls['exampleEditor'] = [ 'tab' => 'content', 'label' => esc_html__( 'Text editor', 'bricks' ), 'type' => 'editor', 'inlineEditing' => [ 'selector' => '.text-editor', // Mount inline editor to this CSS selector 'toolbar' => true, // Enable/disable inline editing toolbar ], 'default' => esc_html__( 'Here goes the content ..', 'bricks' ), ]; }
// Render element HTML public function render() { if ( isset( $this->settings['exampleEditor'] ) ) { echo '<div class="text-editor">' . $this->settings['exampleEditor'] . '</div>'; } }}Was this helpful?
A quick vote and short notes help us improve these docs faster.
Leave a note for us
Please do not include passwords, license keys, or personal data. We store submitted notes to improve the docs.
Thanks for sharing feedback. We're using it to improve these docs.