Skip to content
Snippets Groups Projects

First stab

2 unresolved threads

Closes #3455655

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Julian Pustkuchen
  • 26 return;
    27 }
    28 // Overwrite the page heading:
    29 $variables['content']['#title'] = $newPageHeadingString;
    30 }
    31 }
    32
    33 /**
    34 * Implements hook_page_attachments().
    35 *
    36 * Remove the page_heading metatag from the page attachments, as it isn't a
    37 * "real" meta tag.
    38 */
    39 function metatag_page_heading_page_attachments(array &$attachments) {
    40 // Return early if there are no HTML head attachments.
    41 if (!is_array($attachments['#attached']['html_head']) || empty($attachments['#attached']['html_head'])) {
  • 35 *
    36 * Remove the page_heading metatag from the page attachments, as it isn't a
    37 * "real" meta tag.
    38 */
    39 function metatag_page_heading_page_attachments(array &$attachments) {
    40 // Return early if there are no HTML head attachments.
    41 if (!is_array($attachments['#attached']['html_head']) || empty($attachments['#attached']['html_head'])) {
    42 return;
    43 }
    44 // If the "page_heading" metatag is present, remove it from the page
    45 // attachments, as it isn't a "real" meta tag:
    46 foreach ($attachments['#attached']['html_head'] as $key => $headAttachment) {
    47 if ($headAttachment[1] === 'page_heading') {
    48 unset($attachments['#attached']['html_head'][$key]);
    49 }
    50 }
  • Joshua Sedler added 1 commit

    added 1 commit

    Compare with previous version

  • Joshua Sedler added 1 commit
  • Please register or sign in to reply
    Loading