Skip to content

Control: Editor

Ale Mostajo edited this page Apr 29, 2020 · 1 revision

Control used as a field type to display a text editor (based on wp_editor()).

Usage

class Post extends Model
{
    // Class properties and methods...

    protected function init()
    {
        $this->metaboxes = [
            'metabox_id' => [
                'tabs' => [
                    'tab_id' => [
                        'fields' => [

                            'editor_field' => [
                                'type' => 'editor',
                                'title' => __( 'Text editor' ),
                                'description' => __( 'Editor description, this outputs <i>wp_editor()</i>.' ),
                                'control' => [
                                    'media_buttons' => true,
                                    'drag_drop_upload' => true,
                                    'textarea_rows' => 6,
                                ],
                            ],

                            // Other fields...
                        ],
                    ],
                ],
            ],
        ];
    }
}

Control options

All the editor $settings listed here.