public function TwitterButtonWidget::setSettingsFormStates in Twitter Embed 8
Set the settings form #states based the context selector.
The javascript selector changes, depending on the FieldFormatter or Block implementation.
Parameters
array $form: The original Form array.
string $selector: The javascript selector.
Return value
array The form array with states for form elements.
Overrides TwitterWidgetInterface::setSettingsFormStates
File
- src/
TwitterButtonWidget.php, line 124
Class
- TwitterButtonWidget
- Class TwitterButtonWidget.
Namespace
Drupal\twitter_embedCode
public function setSettingsFormStates(array $form, $selector) {
$form['display_options']['hide_username']['#states'] = [
'visible' => [
[
'input[name="' . $selector . '[display_style]"]' => [
'value' => 'follow-button',
],
],
],
];
$form['display_options']['hide_followers_count']['#states'] = [
'visible' => [
[
'input[name="' . $selector . '[display_style]"]' => [
'value' => 'follow-button',
],
],
],
];
return $form;
}