_file_field_get_description_from_element
function _file_field_get_description_from_element
_file_field_get_description_from_element($element)
Retrieves the file description from a field field element.
This helper function is used by file_field_widget_process_multiple().
Parameters
$element: The element being processed.
Return value
A description of the file suitable for use in the administrative interface.
File
- modules/file/file.field.inc, line 739
- Field module functionality for the File module.
Code
function _file_field_get_description_from_element($element) { // Use the actual file description, if it's available. if (!empty($element['#default_value']['description'])) { return $element['#default_value']['description']; } // Otherwise, fall back to the filename. if (!empty($element['#default_value']['filename'])) { return $element['#default_value']['filename']; } // This is probably a newly uploaded file; no description is available. return FALSE; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!file!file.field.inc/function/_file_field_get_description_from_element/7.x