class SystemModuleTestHooks

Hook implementations for system_module_test.

Hierarchy

Expanded class hierarchy of SystemModuleTestHooks

File

core/modules/system/tests/modules/system_module_test/src/Hook/SystemModuleTestHooks.php, line 12

Namespace

Drupal\system_module_test\Hook
View source
class SystemModuleTestHooks {
    
    /**
     * Implements hook_page_attachments_alter().
     */
    public function pageAttachmentsAlter(&$page) : void {
        // 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]);
            }
        }
    }

}

Members

Title Sort descending Modifiers Object type Summary
SystemModuleTestHooks::pageAttachmentsAlter public function Implements hook_page_attachments_alter().

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