PinterestNohover.php in Metatag 8
File
metatag_pinterest/src/Plugin/metatag/Tag/PinterestNohover.php
View source
<?php
namespace Drupal\metatag_pinterest\Plugin\metatag\Tag;
use Drupal\metatag\Plugin\metatag\Tag\MetaNameBase;
class PinterestNohover extends MetaNameBase {
public function form(array $element = []) {
$form = [
'#type' => 'checkbox',
'#title' => $this
->label(),
'#description' => $this
->description(),
'#default_value' => $this->value === 'nohover' ?: '',
'#required' => isset($element['#required']) ? $element['#required'] : FALSE,
'#element_validate' => [
[
get_class($this),
'validateTag',
],
],
'#return_value' => 'nohover',
];
return $form;
}
}