Skip to content

Instantly share code, notes, and snippets.

@hirozed
Last active January 17, 2021 05:32
Show Gist options
  • Save hirozed/a67c9f71eb4b4e34e8fcf3ef24e40768 to your computer and use it in GitHub Desktop.
Save hirozed/a67c9f71eb4b4e34e8fcf3ef24e40768 to your computer and use it in GitHub Desktop.
WordPress CMB2 Rich Text Field
<?php
$cmb->add_field(
array(
'name' => __( '[CHANGEME-name]', '[CHANGEME-localization]' ),
'id' => '[CHANGEME-id]',
'desc' => __( '[CHANGEME-description]', '[CHANGEME-localization]' ),
'type' => 'wysiwyg',
'options' => array(
'textarea_rows' => 1,
'media_buttons' => false,
'teeny' => true,
'quicktags' => false,
'tinymce' => array(
'toolbar1' => 'bold,italic,link,unlink,undo,redo',
'valid_elements' => 'a[href],strong,em',
),
),
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment