You are here

public function DrupalDefaultMetaTag::getWeight in Metatag 7

Calculate the weight of this meta tag.

Return value

int Weight.

Overrides DrupalMetaTagInterface::getWeight

4 calls to DrupalDefaultMetaTag::getWeight()
DrupalDefaultMetaTag::getElement in ./metatag.inc
Get the HTML tag for this meta tag.
DrupalLinkMetaTag::getElement in ./metatag.inc
Get the HTML tag for this meta tag.
DrupalMaskIconMetaTag::getElement in metatag_favicons/metatag_favicons.mask-icon.class.inc
Get the HTML tag for this meta tag.
DrupalMaskIconMetaTag::getForm in metatag_favicons/metatag_favicons.mask-icon.class.inc
Build the form for this meta tag.

File

./metatag.inc, line 116
Metatag primary classes.

Class

DrupalDefaultMetaTag
The default meta tag class from which all others inherit.

Code

public function getWeight() {
  static $counter = 0;

  // If no weight value is found, stack this meta tag at the end.
  $weight = 100;
  if (!empty($this->info['weight'])) {
    $weight = $this->info['weight'];
  }
  return $weight + $counter++ * 0.1;
}