Skip to content

Instantly share code, notes, and snippets.

@jackfoust
Created January 23, 2015 23:21
Show Gist options
  • Save jackfoust/459d0672c51892e83d57 to your computer and use it in GitHub Desktop.
Save jackfoust/459d0672c51892e83d57 to your computer and use it in GitHub Desktop.
WYSIWYG with Drupal Form API
<?php
$defaults = array(
'value' => '',
'format' => filter_default_format(),
);
$example = variable_get('example_variable', $defaults);
$form_['example'] = array(
'#title' => t(''),
'#type' => 'text_format',
'#description' => t('),
'#default_value' => $example['value'],
'#format' => $example['format'],
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment