当前位置: 首页>>代码示例>>PHP>>正文


PHP ot_fetch_google_fonts函数代码示例

本文整理汇总了PHP中ot_fetch_google_fonts函数的典型用法代码示例。如果您正苦于以下问题:PHP ot_fetch_google_fonts函数的具体用法?PHP ot_fetch_google_fonts怎么用?PHP ot_fetch_google_fonts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ot_fetch_google_fonts函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ot_recognized_google_font_families

 function ot_recognized_google_font_families($field_id)
 {
     $families = array();
     $ot_google_fonts = get_theme_mod('ot_google_fonts', array());
     // Forces an array rebuild when we sitch themes
     if (empty($ot_google_fonts)) {
         $ot_google_fonts = ot_fetch_google_fonts(true, true);
     }
     foreach ((array) $ot_google_fonts as $key => $item) {
         if (isset($item['family'])) {
             $families[$key] = $item['family'];
         }
     }
     return apply_filters('ot_recognized_google_font_families', $families, $field_id);
 }
开发者ID:ex0ample,项目名称:JindaAds,代码行数:15,代码来源:ot-functions-admin.php

示例2: retrieve_google_font

 /**
  * Returns a JSON encoded Google fonts array.
  *
  * @return    array
  *
  * @access    public
  * @since     2.5.0
  */
 public function retrieve_google_font()
 {
     if (isset($_POST['field_id'], $_POST['family'])) {
         ot_fetch_google_fonts();
         echo json_encode(array('variants' => ot_recognized_google_font_variants($_POST['field_id'], $_POST['family']), 'subsets' => ot_recognized_google_font_subsets($_POST['field_id'], $_POST['family'])));
         exit;
     }
 }
开发者ID:b0123498765,项目名称:fithealthyandwealthy,代码行数:16,代码来源:ot-loader.php

示例3: display_setting

 /**
  * Callback for add_settings_field() to build each setting by type
  *
  * @param     array     Setting object array
  * @return    string
  *
  * @access    public
  * @since     2.0
  */
 public function display_setting($args = array())
 {
     extract($args);
     /* get current saved data */
     $options = get_option($get_option, false);
     // Set field value
     $field_value = isset($options[$id]) ? $options[$id] : '';
     /* set standard value */
     if (isset($std)) {
         $field_value = ot_filter_std_value($field_value, $std);
     }
     // Allow the descriptions to be filtered before being displayed
     $desc = apply_filters('ot_filter_description', isset($desc) ? $desc : '', $id);
     /* build the arguments array */
     $_args = array('type' => $type, 'field_id' => $id, 'field_name' => $get_option . '[' . $id . ']', 'field_value' => $field_value, 'field_desc' => $desc, 'field_std' => isset($std) ? $std : '', 'field_rows' => isset($rows) && !empty($rows) ? $rows : 15, 'field_post_type' => isset($post_type) && !empty($post_type) ? $post_type : 'post', 'field_taxonomy' => isset($taxonomy) && !empty($taxonomy) ? $taxonomy : 'category', 'field_min_max_step' => isset($min_max_step) && !empty($min_max_step) ? $min_max_step : '0,100,1', 'field_condition' => isset($condition) && !empty($condition) ? $condition : '', 'field_operator' => isset($operator) && !empty($operator) ? $operator : 'and', 'field_class' => isset($class) ? $class : '', 'field_choices' => isset($choices) && !empty($choices) ? $choices : array(), 'field_settings' => isset($settings) && !empty($settings) ? $settings : array(), 'post_id' => ot_get_media_post_ID(), 'get_option' => $get_option);
     // Limit DB queries for Google Fonts.
     if ($type == 'google-fonts') {
         ot_fetch_google_fonts();
         ot_set_google_fonts($id, $field_value);
     }
     /* get the option HTML */
     echo ot_display_by_type($_args);
 }
开发者ID:Juliaandavid,项目名称:securexa,代码行数:32,代码来源:ot-settings-api.php


注:本文中的ot_fetch_google_fonts函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。