本文整理汇总了PHP中UniteFunctionsWPRev::convertPostDate方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsWPRev::convertPostDate方法的具体用法?PHP UniteFunctionsWPRev::convertPostDate怎么用?PHP UniteFunctionsWPRev::convertPostDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniteFunctionsWPRev
的用法示例。
在下文中一共展示了UniteFunctionsWPRev::convertPostDate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setLayersByPostData
/**
*
* replace layer placeholders by post data
*/
private function setLayersByPostData($postData, $sliderID)
{
$postID = $postData["ID"];
$title = UniteFunctionsRev::getVal($postData, "post_title");
$excerpt_limit = $this->getSliderParam($sliderID, "excerpt_limit", 55, RevSlider::VALIDATE_NUMERIC);
$excerpt_limit = (int) $excerpt_limit;
$excerpt = UniteFunctionsWPRev::getExcerptById($postID, $excerpt_limit);
$alias = UniteFunctionsRev::getVal($postData, "post_name");
$content = UniteFunctionsRev::getVal($postData, "post_content");
$link = get_permalink($postID);
$postDate = UniteFunctionsRev::getVal($postData, "post_date_gmt");
$postDate = UniteFunctionsWPRev::convertPostDate($postDate);
$dateModified = UniteFunctionsRev::getVal($postData, "post_modified");
$dateModified = UniteFunctionsWPRev::convertPostDate($dateModified);
$authorID = UniteFunctionsRev::getVal($postData, "post_author");
$authorName = UniteFunctionsWPRev::getUserDisplayName($authorID);
$postCatsIDs = $postData["post_category"];
$catlist = UniteFunctionsWPRev::getCategoriesHtmlList($postCatsIDs);
$taglist = UniteFunctionsWPRev::getTagsHtmlList($postID);
$numComments = UniteFunctionsRev::getVal($postData, "comment_count");
foreach ($this->arrLayers as $key => $layer) {
$text = UniteFunctionsRev::getVal($layer, "text");
$text = str_replace("%title%", $title, $text);
$text = str_replace("%excerpt%", $excerpt, $text);
$text = str_replace("%alias%", $alias, $text);
$text = str_replace("%content%", $content, $text);
$text = str_replace("%link%", $link, $text);
$text = str_replace("%date%", $postDate, $text);
$text = str_replace("%date_modified%", $dateModified, $text);
$text = str_replace("%author_name%", $authorName, $text);
$text = str_replace("%num_comments%", $numComments, $text);
$text = str_replace("%catlist%", $catlist, $text);
$text = str_replace("%taglist%", $taglist, $text);
//process meta tags:
$arrMatches = array();
$text = str_replace('-', '_REVSLIDER_', $text);
preg_match('/%meta:\\w+%/', $text, $arrMatches);
foreach ($arrMatches as $match) {
$meta = str_replace("%meta:", "", $match);
$meta = str_replace("%", "", $meta);
$meta = str_replace('_REVSLIDER_', '-', $meta);
$metaValue = get_post_meta($postID, $meta, true);
$text = str_replace($match, $metaValue, $text);
}
$text = str_replace('_REVSLIDER_', '-', $text);
//replace event's template
if (UniteEmRev::isEventsExists()) {
$eventData = UniteEmRev::getEventPostData($postID);
if (!empty($eventData)) {
foreach ($eventData as $eventKey => $eventValue) {
$eventPlaceholder = "%event_" . $eventKey . "%";
if ($eventKey == 'start_date' || $eventKey == 'end_date') {
$eventValue = UniteFunctionsWPRev::convertPostDate($eventValue);
}
$text = str_replace($eventPlaceholder, $eventValue, $text);
}
}
}
//$text = str_replace("location", "maxim" , $text);
$layer["text"] = $text;
$this->arrLayers[$key] = $layer;
}
//$allMeta = get_post_meta($postID);
//dmp($allMeta);exit();
}