function media_type_set_defaults in D7 Media 7
Create the basic class and defaults for a media entity bundle type.
1 call to media_type_set_defaults()
- media_type_save in includes/
media.types.inc - Update an existing media type or create a new one.
File
- includes/
media.types.inc, line 148 - Helper functions related to media types. CRUD for saving their settings mainly.
Code
function media_type_set_defaults($info) {
$type = new stdClass();
// This is used to filter a file to the proper bundle.
$type->type_callback = 'media_is_type';
$type->type_callback_args = array();
$type->weight = 0;
foreach ($info as $k => $v) {
$type->{$k} = $v;
}
return $type;
}