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


PHP RevSliderFunctionsWP::getTagsHtmlList方法代码示例

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


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

示例1: setLayersByPostData

 /**
  * 
  * replace layer placeholders by post data
  */
 private function setLayersByPostData($postData, $sliderID)
 {
     $postID = $postData["ID"];
     $attr = array();
     $attr['title'] = RevSliderFunctions::getVal($postData, "post_title");
     $excerpt_limit = $this->getSliderParam($sliderID, "excerpt_limit", 55, RevSlider::VALIDATE_NUMERIC);
     $excerpt_limit = (int) $excerpt_limit;
     $attr['excerpt'] = RevSliderFunctionsWP::getExcerptById($postID, $excerpt_limit);
     $attr['alias'] = RevSliderFunctions::getVal($postData, "post_name");
     $attr['content'] = RevSliderFunctions::getVal($postData, "post_content");
     $attr['link'] = get_permalink($postID);
     $postDate = RevSliderFunctions::getVal($postData, "post_date_gmt");
     $attr['postDate'] = RevSliderFunctionsWP::convertPostDate($postDate);
     $dateModified = RevSliderFunctions::getVal($postData, "post_modified");
     $attr['dateModified'] = RevSliderFunctionsWP::convertPostDate($dateModified);
     $authorID = RevSliderFunctions::getVal($postData, "post_author");
     $attr['authorName'] = RevSliderFunctionsWP::getUserDisplayName($authorID);
     $postCatsIDs = $postData["post_category"];
     $attr['catlist'] = RevSliderFunctionsWP::getCategoriesHtmlList($postCatsIDs);
     $attr['taglist'] = RevSliderFunctionsWP::getTagsHtmlList($postID);
     $ptid = get_post_thumbnail_id($postID);
     $img_sizes = RevSliderBase::get_all_image_sizes();
     $attr['img_urls'] = array();
     foreach ($img_sizes as $img_handle => $img_name) {
         $featured_image_url = wp_get_attachment_image_src($ptid, $img_handle);
         if ($featured_image_url !== false) {
             $attr['img_urls'][$img_handle] = array('url' => $featured_image_url[0], 'tag' => '<img src="' . $featured_image_url[0] . '" width="' . $featured_image_url[1] . '" height="' . $featured_image_url[2] . '" data-no-retina />');
         }
     }
     $numComments = RevSliderFunctions::getVal($postData, "comment_count");
     foreach ($this->arrLayers as $key => $layer) {
         $text = RevSliderFunctions::getVal($layer, "text");
         $text = apply_filters('revslider_mod_meta', $text, $postID, $postData);
         //option to add your own filter here to modify meta to your likings
         $text = $this->set_post_data($text, $attr, $postID);
         $layer["text"] = $text;
         $all_actions = RevSliderFunctions::getVal($layer, 'layer_action', array());
         if (!empty($all_actions)) {
             $a_image_link = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'image_link', array()));
             if (!empty($a_image_link)) {
                 foreach ($a_image_link as $ik => $ilink) {
                     $ilink = $this->set_post_data($ilink, $attr, $postID);
                     $a_image_link[$ik] = $ilink;
                 }
                 $layer['layer_action']->image_link = $a_image_link;
             }
         }
         $this->arrLayers[$key] = $layer;
     }
     for ($mi = 1; $mi <= 10; $mi++) {
         //set params to the post data
         $pa = $this->getParam('params_' . $mi, '');
         $pa = $this->set_post_data($pa, $attr, $postID);
         $this->setParam('params_' . $mi, $pa);
     }
 }
开发者ID:hathbanger,项目名称:squab,代码行数:60,代码来源:slide.class.php


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