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


PHP Essential_Grid_Base::get_custom_media_source_data方法代码示例

本文整理汇总了PHP中Essential_Grid_Base::get_custom_media_source_data方法的典型用法代码示例。如果您正苦于以下问题:PHP Essential_Grid_Base::get_custom_media_source_data方法的具体用法?PHP Essential_Grid_Base::get_custom_media_source_data怎么用?PHP Essential_Grid_Base::get_custom_media_source_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Essential_Grid_Base的用法示例。


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

示例1: output_by_specific_ids

 /**
  * Output by specific ids for load more custom grid
  */
 public function output_by_specific_ids()
 {
     $base = new Essential_Grid_Base();
     $item_skin = new Essential_Grid_Item_Skin();
     $item_skin->grid_id = $this->grid_id;
     $item_skin->set_grid_type($base->getVar($this->grid_params, 'layout', 'even'));
     $item_skin->set_default_image_by_id($base->getVar($this->grid_postparams, 'default-image', 0, 'i'));
     $m = new Essential_Grid_Meta();
     $filters = array();
     $order_by = explode(',', $base->getVar($this->grid_params, 'sorting-order-by', 'date'));
     if (!is_array($order_by)) {
         $order_by = array($order_by);
     }
     $item_skin->init_by_id($base->getVar($this->grid_params, 'entry-skin', 0, 'i'));
     $lazy_load = $base->getVar($this->grid_params, 'lazy-loading', 'off');
     if ($lazy_load == 'on') {
         $item_skin->set_lazy_load(true);
     }
     $default_media_source_order = $base->getVar($this->grid_postparams, 'media-source-order', '');
     $item_skin->set_default_media_source_order($default_media_source_order);
     $default_lightbox_source_order = $base->getVar($this->grid_params, 'lb-source-order', '');
     $item_skin->set_default_lightbox_source_order($default_lightbox_source_order);
     $default_aj_source_order = $base->getVar($this->grid_params, 'aj-source-order', '');
     $item_skin->set_default_ajax_source_order($default_aj_source_order);
     $post_media_source_type = $base->getVar($this->grid_postparams, 'image-source-type', 'full');
     $default_video_poster_order = $base->getVar($this->grid_params, 'poster-source-order', '');
     $item_skin->set_default_video_poster_order($default_video_poster_order);
     $layout = $base->getVar($this->grid_params, 'layout', 'even');
     $layout_sizing = $base->getVar($this->grid_params, 'layout-sizing', 'boxed');
     if ($layout_sizing !== 'fullwidth' && $layout == 'masonry') {
         $item_skin->set_poster_cropping(true);
     }
     $skins_html = '';
     $found_filter = array();
     if (!empty($this->grid_layers) && count($this->grid_layers) > 0) {
         foreach ($this->grid_layers as $key => $entry) {
             if (!in_array($key, $this->filter_by_ids)) {
                 continue;
             }
             $post_media_source_data = $base->get_custom_media_source_data($entry, $post_media_source_type);
             $post_video_ratios = $m->get_custom_video_ratios($entry);
             $filters = array();
             if (is_array($order_by) && !empty($order_by)) {
                 //$sort = $this->prepare_sorting_array_by_post($post, $order_by);
                 //$item_skin->set_sorting($sort);
             }
             if (!empty($entry['custom-filter'])) {
                 $cats = explode(',', $entry['custom-filter']);
                 if (!is_array($cats)) {
                     $cats = (array) $cats;
                 }
                 foreach ($cats as $category) {
                     $filters[sanitize_key($category)] = array('name' => $category, 'slug' => sanitize_key($category));
                 }
             }
             $found_filter = $found_filter + $filters;
             //these are the found filters, only show filter that the posts have
             $item_skin->set_filter($filters);
             $item_skin->set_media_sources($post_media_source_data);
             $item_skin->set_media_sources_type($post_media_source_type);
             $item_skin->set_video_ratios($post_video_ratios);
             $item_skin->set_layer_values($entry);
             $item_skin->set_load_more();
             //switch to different skin
             $use_item_skin_id = $base->getVar($entry, 'use-skin', '-1');
             if (intval($use_item_skin_id) === 0) {
                 $use_item_skin_id = -1;
             }
             $item_skin->switch_item_skin($use_item_skin_id);
             $item_skin->register_layer_css();
             $item_skin->register_skin_css();
             ob_start();
             $item_skin->output_item_skin();
             $skins_html .= ob_get_contents();
             ob_clean();
             ob_end_clean();
         }
     } else {
         return false;
     }
     return $skins_html;
 }
开发者ID:kfwebdev,项目名称:wp-atd,代码行数:85,代码来源:essential-grid.class.php


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