condition_path-1.0.0-beta2/condition_path.module
condition_path.module
<?php /** * @file * Main module file containing hooks. */ use Drupal\Core\Form\FormStateInterface; /** * Implements hook_form_FORM_ID_alter() for block_form. */ function condition_path_form_block_form_alter(&$form, FormStateInterface $form_state, $form_id) { // On block edit forms, make the visibility plugin title in line with core's // "Pages". if (isset($form['visibility']['request_path_inclexcl'])) { $form['visibility']['request_path_inclexcl']['#title'] = t('Pages (include and exclude)'); // Group core's "Pages" and this module's "Pages" plugin. if (isset($form['visibility']['request_path'])) { $form['visibility']['request_path']['#weight'] = -5; $form['visibility']['request_path_inclexcl']['#weight'] = $form['visibility']['request_path']['#weight'] + 1; } } }