You are here

function _manualcrop_media_element_add_after_build in Manual Crop 7

Adds the #after_build entry to a media element.

Parameters

$element: The element to alter.

Return value

TRUE if the element was altered, FALSE otherwise.

1 call to _manualcrop_media_element_add_after_build()
manualcrop_field_widget_form_alter in ./manualcrop.module
Implements hook_field_widget_form_alter().

File

./manualcrop.helpers.inc, line 271
Helper functions for the Manual Crop module.

Code

function _manualcrop_media_element_add_after_build(&$element) {
  if (isset($element['#media_options']['global']) && isset($element['#entity_type']) && isset($element['#bundle'])) {
    $element['#after_build'][] = 'manualcrop_media_element_after_build';
    return TRUE;
  }
  return FALSE;
}