content_moderation_bypass-8.x-1.0-alpha6/content_moderation_bypass.module

content_moderation_bypass.module
<?php

/**
 * @file
 * Contains content_moderation_bypass.module.
 */

use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Entity\EntityTypeInterface;

/**
 * Implements hook_entity_bundle_field_info_alter().
 */
function content_moderation_bypass_entity_base_field_info_alter(&$fields, EntityTypeInterface $entity_type) {
  if (isset($fields['moderation_state'])) {
    $fields['moderation_state']->addConstraint('BypassModerationState', []);
  }
}

/**
 * Implements hook_help().
 */
function content_moderation_bypass_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    // Main module help for the content_moderation_bypass module.
    case 'help.page.content_moderation_bypass':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('Module to bypass all transition state restrictions and set content to any state.') . '</p>';
      return $output;

    default:
  }
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc