public function ImageWidget::preprocessElement in Open Social 8.4
Same name and namespace in other branches
- 8.9 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php \Drupal\socialbase\Plugin\Preprocess\ImageWidget::preprocessElement()
- 8 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php \Drupal\socialbase\Plugin\Preprocess\ImageWidget::preprocessElement()
- 8.2 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php \Drupal\socialbase\Plugin\Preprocess\ImageWidget::preprocessElement()
- 8.3 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php \Drupal\socialbase\Plugin\Preprocess\ImageWidget::preprocessElement()
- 8.5 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php \Drupal\socialbase\Plugin\Preprocess\ImageWidget::preprocessElement()
- 8.6 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php \Drupal\socialbase\Plugin\Preprocess\ImageWidget::preprocessElement()
- 8.7 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php \Drupal\socialbase\Plugin\Preprocess\ImageWidget::preprocessElement()
- 8.8 themes/socialbase/src/Plugin/Preprocess/ImageWidget.php \Drupal\socialbase\Plugin\Preprocess\ImageWidget::preprocessElement()
Preprocess the variables array if an element is present.
Parameters
\Drupal\bootstrap\Utility\Element $element: The Element object.
\Drupal\bootstrap\Utility\Variables $variables: The Variables object.
Overrides ImageWidget::preprocessElement
File
- themes/
socialbase/ src/ Plugin/ Preprocess/ ImageWidget.php, line 25
Class
- ImageWidget
- Pre-processes variables for the "image_widget" theme hook.
Namespace
Drupal\socialbase\Plugin\PreprocessCode
public function preprocessElement(Element $element, Variables $variables) {
if (isset($variables['element']['#id']) && $variables['element']['#id'] == 'edit-field-post-image-0-upload') {
$variables['in_post'] = TRUE;
}
if (isset($variables['data']['remove_button'])) {
$variables['data']['remove_button']['#button_type'] = 'flat';
}
parent::preprocessElement($element, $variables);
}