This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* EXAMPLE FEATURE UPDATE | |
* Enable and revert the my_new_feature_name feature. | |
*/ | |
function example_update_7001() { | |
// An array of new or changed features; the array keys are feature names, | |
// values are an array of exportable types as seen in a feature's .info file: | |
// features[field][] = node-page-body | |
$features = array( | |
'my_new_feature_name' => array('field', 'variable'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_field_formatter_info(). | |
*/ | |
function custom_field_formatter_info() { | |
$formatters = array(); | |
$formatters['custom_event_time'] = array( | |
'label' => t('CUSTOM: Event Time'), | |
'description' => t('Displays this field normally if it has a value, if empty, it displays the time from field_event_date.'), | |
'field types' => array('text'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_media_token_to_markup_alter(). | |
* | |
* Allow non-image files to be embedded in the WYSIWYG by converting the | |
* 'preview' markup to be shown in the WYSIWYG to an image preview of the file. | |
*/ | |
function custom_media_token_to_markup_alter(&$element, $tag_info, $settings) { | |
if (!empty($settings['wysiwyg']) && $tag_info['file']->type != 'image') { |