Skip to content

Commit

Permalink
Remove variable for attribute, document why the change was made.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jen Lampton committed Jan 2, 2021
1 parent fe767da commit 89a1484
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions metatag.inc
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,23 @@ class BackdropDefaultMetaTag implements BackdropMetaTagInterface {
}

// Combine the base configuration for this meta tag with the value.
$attribute = 'name';
$element = $base_element + array(
'#tag' => 'meta',
'#attributes' => array(
$attribute => $this->info['name'],
'content' => $value,
),
'#weight' => $this->getWeight(),
);

if (in_array($this->info['group'], array('facebook', 'open-graph'))) {
// Open Graph tags need a property attribute, instead of name.
$element['#attributes']['property'] = $this->info['name'];
}
else {
// Fall back to name attribute for all others.
$element['#attributes']['name'] = $this->info['name'];
}

// Add header information if desired.
if (!empty($this->info['header'])) {
$element['#attached']['backdrop_add_http_header'][] = array($this->info['header'], $value);
Expand Down

0 comments on commit 89a1484

Please sign in to comment.