Created
June 3, 2013 21:41
-
-
Save pfaocle/5701686 to your computer and use it in GitHub Desktop.
Save File Entity file display settings in code - uses CTools exportables.
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 | |
// We assume that a custom module is implementing a file formatter | |
// called 'mymodule_custom_file_formatter'. | |
$filetype = 'video'; // File type to alter file display for. | |
$display = 'preview'; // File display to alter - 'default', 'teaser' or 'preview'. | |
$video_display = file_display_new($filetype, $display, 'mymodule_custom_file_formatter'); | |
$video_display->export_type = 1; | |
$video_display->table = 'file_display'; | |
$video_display->type = 'Normal'; | |
$video_display->status = 1; | |
file_display_save($video_display); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment