You are here

function yoast_seo_form_node_afterbuild in Real-time SEO for Drupal 8

After build function.

Reads the form, and deduct associated yoastseo configuration from it.

Parameters

array $form: The form array.

\Drupal\Core\Form\FormStateInterface $form_state: The form state array.

Return value

mixed The modified form.

1 string reference to 'yoast_seo_form_node_afterbuild'
yoast_seo_form_node_form_alter in ./yoast_seo.module
Implements hook_form_FORM_ID_alter() for node_form().

File

./yoast_seo.module, line 37
Contains yoast_seo.module.

Code

function yoast_seo_form_node_afterbuild($form, FormStateInterface $form_state) {
  if (isset($form['field_yoast_seo'])) {
    $yoast_seo_manager = \Drupal::service('yoast_seo.manager');
    $yoast_seo_field_manager = \Drupal::service('yoast_seo.field_manager');
    $form = $yoast_seo_manager
      ->setGeneralConfiguration($form);
    $form = $yoast_seo_field_manager
      ->setFieldsConfiguration($form);
    $form = $yoast_seo_manager
      ->setTargetsConfiguration($form);
    $form = $yoast_seo_manager
      ->setScoreToStatusRulesConfiguration($form);
    $form = $yoast_seo_field_manager
      ->addSnippetEditorMarkup($form);
    $form = $yoast_seo_field_manager
      ->addOverallScoreMarkup($form, $form_state);
  }
  return $form;
}