本文整理汇总了PHP中RevSliderFunctionsWP::getPathContent方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderFunctionsWP::getPathContent方法的具体用法?PHP RevSliderFunctionsWP::getPathContent怎么用?PHP RevSliderFunctionsWP::getPathContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderFunctionsWP
的用法示例。
在下文中一共展示了RevSliderFunctionsWP::getPathContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setImageByImageID
/**
*
* set slide image by image id
*/
private function setImageByImageID($imageID)
{
$imgResolution = RevSliderFunctions::getVal($this->params, 'image_source_type', 'full');
$this->imageID = $imageID;
$this->imageUrl = RevSliderFunctionsWP::getUrlAttachmentImage($imageID, $imgResolution);
$this->imageThumb = RevSliderFunctionsWP::getUrlAttachmentImage($imageID, RevSliderFunctionsWP::THUMB_MEDIUM);
if (empty($this->imageUrl)) {
return false;
}
$this->params["background_type"] = "image";
if (is_ssl()) {
$this->imageUrl = str_replace("http://", "https://", $this->imageUrl);
}
$this->imageFilepath = RevSliderFunctionsWP::getImagePathFromURL($this->imageUrl);
$realPath = RevSliderFunctionsWP::getPathContent() . $this->imageFilepath;
if (file_exists($realPath) == false || is_file($realPath) == false) {
$this->imageFilepath = "";
}
$this->imageFilename = basename($this->imageUrl);
}
示例2: onShowImage
/**
*
* on show image ajax event. outputs image with parameters
*/
public static function onShowImage()
{
$pathImages = RevSliderFunctionsWP::getPathContent();
$urlImages = RevSliderFunctionsWP::getUrlContent();
try {
$imageID = intval(RevSliderFunctions::getGetVar("img"));
$img = wp_get_attachment_image_src($imageID, 'thumb');
if (empty($img)) {
exit;
}
self::outputImage($img[0]);
} catch (Exception $e) {
header("status: 500");
echo $e->getMessage();
exit;
}
}