system_module_test.module

Same filename in other branches
  1. 9 core/modules/system/tests/modules/system_module_test/system_module_test.module
  2. 10 core/modules/system/tests/modules/system_module_test/system_module_test.module
  3. 11.x core/modules/system/tests/modules/system_module_test/system_module_test.module

Provides System module hook implementations for testing purposes.

File

core/modules/system/tests/modules/system_module_test/system_module_test.module

View source
<?php


/**
 * @file
 * Provides System module hook implementations for testing purposes.
 */

/**
 * Implements hook_page_attachments_alter().
 */
function system_module_test_page_attachments_alter(&$page) {
    // Remove the HTML5 mobile meta-tags.
    $meta_tags_to_remove = [
        'MobileOptimized',
        'HandheldFriendly',
        'viewport',
        'cleartype',
    ];
    foreach ($page['#attached']['html_head'] as $index => $parts) {
        if (in_array($parts[1], $meta_tags_to_remove)) {
            unset($page['#attached']['html_head'][$index]);
        }
    }
}

Functions

Title Deprecated Summary
system_module_test_page_attachments_alter Implements hook_page_attachments_alter().

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.