MagpieFromSimplePie::handleAttributes PHP Method

handleAttributes() public method

MagpieFromSimplePie::handleAttributes
public handleAttributes ( array $data, array $path ) : array
$data array
$path array
return array
    function handleAttributes($data, $path)
    {
        $tagPath = strtolower(implode('_', $path));
        $ret = array();
        if (isset($data['attribs'])) {
            foreach ($data['attribs'] as $ns => $pairs) {
                if (isset($this->_XMLNS_FAMILIAR[$ns])) {
                    $ns = $this->_XMLNS_FAMILIAR[$ns];
                }
                foreach ($pairs as $attr => $value) {
                    $attr = strtolower($attr);
                    if ($ns == 'rdf' and $attr == 'about') {
                        $ret['about'] = $value;
                    } elseif (strlen($tagPath) > 0) {
                        if (strlen($ns) > 0 and $this->is_namespaced($ns, true)) {
                            $attr = $ns . ':' . $attr;
                        }
                        $ret[$tagPath . '@' . $attr] = $value;
                        if (isset($ret[$tagPath . '@']) and strlen($ret[$tagPath . '@']) > 0) {
                            $ret[$tagPath . '@'] .= ',';
                        } else {
                            $ret[$tagPath . '@'] = '';
                        }
                        $ret[$tagPath . '@'] .= $attr;
                    }
                }
            }
        }
        return apply_filters('feedwordpress_magpiefromsimplepie_handleattributes', $ret, $data, $path, $this);
    }