protected function getLinkCssMedia(array $tag_frag, $test_for_css = true)
    {
        if ($test_for_css && !$this->isLinkTagFragCss($tag_frag)) {
            return ''; // This tag does not contain CSS.
        }
        if (preg_match('/\smedia\s*\=\s*(["\'])(?P<value>.+?)\\1/ui', $tag_frag['link_self_closing_tag'], $_m)) {
            return trim(mb_strtolower($_m['value']));
        } // unset($_m); // Just a little housekeeping.

        return ''; // Unable to find a `media` attribute value.
    }
protected function getLinkCssMedia(array $tag_frag, $test_for_css = true)
    {
        if ($test_for_css && !$this->isLinkTagFragCss($tag_frag)) {
            return ''; // This tag does not contain CSS.
        }
        if (preg_match('/\smedia\s*\=\s*(["\'])(?P<value>.+?)\\1/ui', $tag_frag['link_self_closing_tag'], $_m)) {
            return trim(mb_strtolower($_m['value']));
        } // unset($_m); // Just a little housekeeping.

        return ''; // Unable to find a `media` attribute value.
    }
protected function getLinkCssMedia ( array $ tag_frag , $ test_for_css = true ) { if ( $ test_for_css && ! $ this -> isLinkTagFragCss ( $ tag_frag ) ) { return '' ; // This tag does not contain CSS. } if ( preg_match ( '/\smedia\s*\=\s*(["\'])(?P<value>.+?)\\1/ui' , $ tag_frag [ 'link_self_closing_tag' ] , $ _m ) ) { return trim ( mb_strtolower ( $ _m [ 'value' ] ) ) ; } // unset($_m); // Just a little housekeeping. return '' ; // Unable to find a `media` attribute value. }
Get a CSS link media rule from a tag fragment.

@since 140417 Initial release.

@param array $tag_frag     A CSS tag fragment.
@param bool  $test_for_css Defaults to a TRUE value.
If TRUE, we will test tag fragment to make sure it's CSS.

@return string The link media value if possible; else an empty string.
Get a CSS link media rule from a tag fragment .