Creates and returns meta tags

@param boolean $data_only
Set to true if you want to get get only the data without a generated html

@return string|array
511850
final protected function getMeta($data_only = false)
    {
        $meta_stack = $this->page->meta->getTags();

        if ($data_only) {
            return $meta_stack;
        }

        $html = '';

        foreach ($meta_stack as $tag) {

            $html .= PHP_EOL . '<meta';

            foreach ($tag as $attribute => $value) {
                $html .= ' ' . $attribute . '="' . $value . '"';
            }

            $html .= '>';
        }

        return $html;
    }
239056
public static function Get($view_name, $data = null)
    {
        ob_start();
        include static::$ViewRoot . $view_name . '.php';
        $view = ob_get_contents();
        ob_end_clean();
        $result = $view;
        return $result;
    }
1269779
public function getTwitterMetaTags()
    {
        $title = htmlspecialchars($this->owner->getOGTitle());
        $description = htmlspecialchars($this->owner->getOGDescription());
        $tMeta = "\n<meta name=\"twitter:title\" content=\"$title\">"
            . "\n<meta name=\"twitter:description\" content=\"$description\">";

        // If we have a big enough image, include an image tag.
        $image = $this->owner->getOGImage();
        // $image may be a string - don't generate a specific twitter tag
        // in that case as it is probably the default resource.
        if ($image instanceof Image && $image->getWidth() >= 280) {
            $imageURL = htmlspecialchars(Director::absoluteURL($image->Link()));
            $tMeta .= "\n<meta name=\"twitter:card\" content=\"summary_large_image\">"
                . "\n<meta name=\"twitter:image\" content=\"$imageURL\">";
        }

        $username = self::config()->get('twitter_username');
        if ($username) {
            $tMeta .= "\n<meta name=\"twitter:site\" content=\"@$username\">"
                . "\n<meta name=\"twitter:creator\" content=\"@$username\">";
        }

        return $tMeta;
    }
640126
public function meta($type, $data, $names = null)
    {
        $result = [];
        $names = $names ? (array) $names : array_keys($data);
        foreach ($names as $name) {
            $value = isset($data[$name]) ? $data[$name] : null;
            if ($value && $meta = $this->_meta($type, $name, $value)) {
                $result[] = $meta;
            }
        }
        return join(' ', $result);
    }
689235
public function parse($tag_name = null)
    {
        $namespaces = $this->feed->getNamespaces();
        $specs = \WebSyndication\Helper::getSpecifications($this->feed->getProtocol(), $this->feed->getVersion());
        if (!empty($tag_name) && isset($specs[$tag_name])) {

//if (self::$_debug) echo '<br />specs : '.var_export($specs,1);
//if (self::$_debug) echo '<br />XML : '.var_export($this->getXml(),1);

            foreach ($specs[$tag_name] as $var=>$spe) {
                $tagval = self::parseTag($this->getXml(), $var, $spe, $specs);
                if ($tagval) {
                    if (isset($spe['rename'])) {
                        $var = $spe['rename'];
                    }
                    if (self::$_debug) {
                        echo '<br />adding data for tag name "'.$var.'" : '.var_export($tagval, 1);
                    }
                    $this->addData($var, $tagval);
                }
            }
        } else {
            throw new \InvalidArgumentException(
                sprintf('Syndication parser method requires a valid tag name argument (got "%s")!', $tag_name)
            );
        }

        if (self::$_debug) {
            echo '<hr />finally got data : '.var_export($this->getData(), 1);
        }
        return $this->getData();
    }
147667
public function getDataAttributesHtml(array $row_data = []): string
    {
        if (!$row_data) {
            $row_data = [];
        }

        $html = [];

        foreach ($this->data_attributes as $k => $v) {
            $html[] = ' data-' . $k . '="' . $this->replaceTemplateVars($row_data, $v) . '"';
        }

        return implode(' ', $html);
    }
448178
public function insert( $data, $convert_name = true ) {
		$_data                 = [];
		$_data['post_type']    = $this->get_post_type();
		$_data['post_title']   = $this->app->utility->array_get( $data, 'post_title', '' );
		$_data['post_content'] = $this->app->utility->array_get( $data, 'post_content', '' );
		$_data['post_status']  = $this->app->utility->array_get( $data, 'post_status', 'publish' );
		unset( $data['post_type'] );
		unset( $data['post_title'] );
		unset( $data['post_content'] );
		unset( $data['post_status'] );

		foreach ( $this->get_data_field_settings() as $k => $v ) {
			$name = $convert_name ? $this->get_post_field_name( $k ) : $k;
			unset( $_POST[ $name ] );
		}
		foreach ( $data as $k => $v ) {
			$name           = $convert_name ? $this->get_post_field_name( $k ) : $k;
			$_data[ $name ] = $v;
			$_POST[ $name ] = $v;
		}

		return wp_insert_post( $_data );
	}
365420
public function meta()
    {
        $meta = [];

        // look for basic parameters of transactions, only unconfirmed
        // transactions will have those fields empty.

        if (isset($this->attributes["id"]))
            $meta["id"] = (int) $this->attributes["id"];

        if (isset($this->attributes["height"]))
            $meta["height"] = (int) $this->attributes["height"];

        if (isset($this->attributes["hash"]))
            $meta["hash"] = ["data" => $this->attributes["hash"]];

        return $meta;
    }
134192
private function generateMeta(bbMetaData $meta)
    {
        if (0 === $meta->count() || 'title' === $meta->getName()) {
            return '';
        }

        $result = '<meta ';
        foreach ($meta as $attribute => $value) {
            if (false !== strpos($meta->getName(), 'keyword') && 'content' === $attribute) {
                $keywords = explode(',', $value);
                foreach ($this->getKeywordObjects($keywords) as $object) {
                    $value = trim(str_replace($object->getUid(), $object->getKeyWord(), $value), ',');
                }
            }

            if ('content' === $attribute && empty($value)) {
                $result = '';
                break;
            }

            $result .= $attribute . '="' . html_entity_decode($value, ENT_COMPAT, 'UTF-8') . '" ';
        }

        return empty($result) ? $result : $result.'/>'.PHP_EOL;
    }
39916
final protected function getScript($area, $data_only = false)
    {
        $files = $this->page->js->getFiles($area);

        if ($data_only) {
            return $files;
        }

        // Init output var
        $html = '';

        // Create files
        foreach ($files as $file) {

            // Create script html object
            $html .= PHP_EOL . '<script src="' . $file . '"></script>';
        }

        return $html;
    }
403700
final protected function getHeadLinks($data_only = false)
    {
        $link_stack = $this->page->link->getLinkStack();

        if ($data_only) {
            return $link_stack;
        }

        $html = '';

        foreach ($link_stack as $link) {

            $html .= PHP_EOL . '<link';

            foreach ($link as $attribute => $value) {
                $html .= ' ' . $attribute . '="' . $value . '"';
            }

            $html .= '>';
        }

        return $html;
    }
1106876
def render_custom(tags)
      meta_tags.meta_tags.each do |name, data|
        Array(data).each do |val|
          tags << Tag.new(:meta, configured_name_key(name) => name, content: val)
        end
        meta_tags.extract(name)
      end
    end
660347
protected function renderMetaTags(array $metaTags)
    {
        $ret = array();

        $isXhtml = $this->isXhtml();

        foreach ($metaTags as $metaTag) {
            $tag = $metaTag['tag'];

            $attributes = array();

            foreach ($metaTag['attributes'] as $key => $value) {
                $attributes[] = $key . '="' . htmlspecialchars($value) . '"';
            }

            if ($isXhtml) {
                $ret[] = '<' . $tag . ' ' . implode(' ', $attributes) . '/>';
            } else {
                $ret[] = '<' . $tag . ' ' . implode(' ', $attributes) . '>';
            }
        }

        $separator = "\n";

        return $separator . implode($separator, $ret) . $separator;
    }
956775
public function getData($url = '')
    {
        $url = empty($url) ? $this->url : $url;
        $title = $tags = '';
        $contents = $this->html;

        if (preg_match('/(<h.+?>(.+?)<\/h.>)/si', $this->html, $matches)) {
            $title = $matches[2];

            // Pull out the meta data section.
            $tags = substr($contents, 0, strpos($contents, $matches[1]));
            $contents = substr($contents, strpos($contents, $matches[1]));

            // Remove the title from the contents.
            $contents = str_replace($matches[0], '', $contents);
        }

        if ($tags && preg_match('/tags\s*:(.*?)</si', $tags, $matches)) {
            $tags = explode(' ', $matches[1]);
        }
        else {
            $tags = array();
        }

        // Insert spaces for new lines to help format the strip_tags.
        $contents = implode(' ', explode(PHP_EOL, $contents));
        $contents = strip_tags($contents);

        return new SearchPageData($url, $title, $contents, $tags);
    }
1191164
private function get_metadata( $post_id ) {
		$metadata = get_metadata( 'post', $post_id );
		$items    = [];
		foreach ( $metadata as $key => $values ) {
			foreach ( $values as $item_value ) {
				$item_value    = maybe_unserialize( $item_value );
				$items[ $key ] = $item_value;
			}
		}

		return $items;
	}
849777
public static function tags()
    {
        $args = func_get_args();
        $ret = NULL;
        foreach($args as $a)
        {
            $class = "";
            $id = "";
            $type = "";
            $text = "";
            
            if(isset($a['class']))
                $class = $a['class'];
            if(isset($a['id']))
                $id    = $a['id'];
            if(isset($a['type']))
                $type  = $a['type'];
            if(isset($a['text']))
                $text = $a['text'];
            
            unset($a['class'],$a['id'], $a['type'],$a['text']);
            
            $ret .= self::tag($type, $text, $class, $id, $a) . PHP_EOL;
            
        }
        
        return $ret;
    }
656940
public function setHeadData($data)
	{
		if (empty($data) || !is_array($data))
		{
			return;
		}

		$this->title        = (isset($data['title']) && !empty($data['title'])) ? $data['title'] : $this->title;
		$this->description  = (isset($data['description']) && !empty($data['description'])) ? $data['description'] : $this->description;
		$this->link         = (isset($data['link']) && !empty($data['link'])) ? $data['link'] : $this->link;

		$this->_metaTags    = (isset($data['metaTags']) && !empty($data['metaTags'])) ? $data['metaTags'] : $this->_metaTags;
		$this->_links       = (isset($data['links']) && !empty($data['links'])) ? $data['links'] : $this->_links;
		$this->_styleSheets = (isset($data['styleSheets']) && !empty($data['styleSheets'])) ? $data['styleSheets'] : $this->_styleSheets;
		$this->_style       = (isset($data['style']) && !empty($data['style'])) ? $data['style'] : $this->_style;
		$this->_scripts     = (isset($data['scripts']) && !empty($data['scripts'])) ? $data['scripts'] : $this->_scripts;
		$this->_script      = (isset($data['script']) && !empty($data['script'])) ? $data['script'] : $this->_script;
		$this->_custom      = (isset($data['custom']) && !empty($data['custom'])) ? $data['custom'] : $this->_custom;

		return $this;
	}