You are here

public function YoastSeoManager::detachYoastSeoFields in Real-time SEO for Drupal 8

Delete the yoast seo fields from a target content type.

Parameters

string $entity_type: Entity type.

string $bundle: Bundle.

File

src/YoastSeoManager.php, line 94

Class

YoastSeoManager
Class YoastSeoManager.

Namespace

Drupal\yoast_seo

Code

public function detachYoastSeoFields($entity_type, $bundle) {

  // Detach seo fields from the target content type.
  $yoast_fields = [
    'field_yoast_seo',
  ];
  foreach ($yoast_fields as $field_name) {
    $this->yoast_seo_field_manager
      ->detachField($entity_type, $bundle, $field_name);
  }
}