コード例 #1
0
 /**
  *
  * get html font import
  */
 public static function getCleanFontImport($font, $class = '', $url = '')
 {
     $setBase = is_ssl() ? "https://" : "http://";
     if ($class !== '') {
         $class = ' class="' . $class . '"';
     }
     if (strpos($font, "href=") === false) {
         //fallback for old versions
         $url = RevSliderFront::modify_punch_url($setBase . 'fonts.googleapis.com/css?family=');
         return '<link href="' . $url . $font . '"' . $class . ' rel="stylesheet" property="stylesheet" type="text/css" media="all" />';
         //id="rev-google-font"
     } else {
         $font = str_replace(array('http://', 'https://'), array($setBase, $setBase), $font);
         return html_entity_decode(stripslashes($font));
     }
 }
コード例 #2
0
ファイル: operations.class.php プロジェクト: surreal8/wptheme
 /**
  *
  * get html font import
  */
 public static function getCleanFontImport($font, $class = '', $url = '')
 {
     global $revslider_fonts;
     if (!isset($revslider_fonts)) {
         $revslider_fonts = array();
     }
     //if this is called without revslider.php beeing loaded
     if (in_array($font, $revslider_fonts)) {
         return '';
     }
     $setBase = is_ssl() ? "https://" : "http://";
     if ($class !== '') {
         $class = ' class="' . $class . '"';
     }
     $revslider_fonts[] = $font;
     if (strpos($font, "href=") === false) {
         //fallback for old versions
         $url = RevSliderFront::modify_punch_url($setBase . 'fonts.googleapis.com/css?family=');
         return '<link href="' . $url . urlencode($font) . '"' . $class . ' rel="stylesheet" property="stylesheet" type="text/css" media="all" />';
         //id="rev-google-font"
     } else {
         $font = str_replace(array('http://', 'https://'), array($setBase, $setBase), $font);
         return html_entity_decode(stripslashes($font));
     }
 }