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