本文整理汇总了PHP中RevSliderFunctions::convertStdClassToArray方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderFunctions::convertStdClassToArray方法的具体用法?PHP RevSliderFunctions::convertStdClassToArray怎么用?PHP RevSliderFunctions::convertStdClassToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderFunctions
的用法示例。
在下文中一共展示了RevSliderFunctions::convertStdClassToArray方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateStaticSlideFromData
/**
*
* update slide from data
* @param $data
*/
public function updateStaticSlideFromData($data)
{
$slideID = RevSliderFunctions::getVal($data, "slideid");
$this->initByStaticID($slideID);
//treat layers
$layers = RevSliderFunctions::getVal($data, "layers");
if (gettype($layers) == "string") {
$layersStrip = stripslashes($layers);
$layersDecoded = json_decode($layersStrip);
if (empty($layersDecoded)) {
$layersDecoded = json_decode($layers);
}
$layers = RevSliderFunctions::convertStdClassToArray($layersDecoded);
}
if (empty($layers) || gettype($layers) != "array") {
$layers = array();
}
$layers = $this->normalizeLayers($layers);
$settings = RevSliderFunctions::getVal($data, "settings");
$arrUpdate = array();
$arrUpdate["layers"] = json_encode($layers);
$arrUpdate["settings"] = json_encode($settings);
$this->db->update(RevSliderGlobals::$table_static_slides, $arrUpdate, array("id" => $this->id));
//RevSliderOperations::updateDynamicCaptions();
}
示例2: filterOneSlide
/**
*
* filter the slides for one slide preview
*/
private function filterOneSlide($slides)
{
$oneSlideID = $this->oneSlideData['slideid'];
if (strpos($oneSlideID, 'static_') !== false) {
global $wpdb;
$sliderID = str_replace('static_', '', $oneSlideID);
$tmp_slides = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . RevSliderGlobals::$table_static_slides . " WHERE slider_id = %s", array($sliderID)), ARRAY_A);
if (!empty($tmp_slides)) {
$n_slides = new RevSliderSlide();
$n_slides->initByData($tmp_slides[0]);
$slides[0] = $n_slides;
$oneSlideID = $n_slides->getID();
}
}
$oneSlideParams = RevSliderFunctions::getVal($this->oneSlideData, 'params');
$oneSlideLayers = RevSliderFunctions::getVal($this->oneSlideData, 'layers');
if (gettype($oneSlideParams) == 'object') {
$oneSlideParams = (array) $oneSlideParams;
}
if (gettype($oneSlideLayers) == 'object') {
$oneSlideLayers = (array) $oneSlideLayers;
}
if (!empty($oneSlideLayers)) {
$oneSlideLayers = RevSliderFunctions::convertStdClassToArray($oneSlideLayers);
}
$newSlides = array();
foreach ($slides as $slide) {
$slideID = $slide->getID();
if ($slideID == $oneSlideID) {
if (!empty($oneSlideParams)) {
$slide->setParams($oneSlideParams);
}
if (!empty($oneSlideLayers)) {
$slide->setLayers($oneSlideLayers);
}
$newSlides[] = $slide;
//add 2 slides
$newSlides[] = $slide;
}
}
return $newSlides;
}
示例3: getCategoriesByIDs
/**
*
* get categories by id's
*/
public static function getCategoriesByIDs($arrIDs, $strTax = null)
{
if (empty($arrIDs)) {
return array();
}
if (is_string($arrIDs)) {
$strIDs = $arrIDs;
} else {
$strIDs = implode(",", $arrIDs);
}
$args = array();
$args["include"] = $strIDs;
if (!empty($strTax)) {
if (is_string($strTax)) {
$strTax = explode(",", $strTax);
}
$args["taxonomy"] = $strTax;
}
$arrCats = get_categories($args);
if (!empty($arrCats)) {
$arrCats = RevSliderFunctions::convertStdClassToArray($arrCats);
}
return $arrCats;
}
示例4: filterOneSlide
/**
*
* filter the slides for one slide preview
*/
private function filterOneSlide($slides)
{
$oneSlideID = $this->oneSlideData['slideid'];
$oneSlideParams = RevSliderFunctions::getVal($this->oneSlideData, 'params');
$oneSlideLayers = RevSliderFunctions::getVal($this->oneSlideData, 'layers');
if (gettype($oneSlideParams) == 'object') {
$oneSlideParams = (array) $oneSlideParams;
}
if (gettype($oneSlideLayers) == 'object') {
$oneSlideLayers = (array) $oneSlideLayers;
}
if (!empty($oneSlideLayers)) {
$oneSlideLayers = RevSliderFunctions::convertStdClassToArray($oneSlideLayers);
}
$newSlides = array();
foreach ($slides as $slide) {
$slideID = $slide->getID();
if ($slideID == $oneSlideID) {
if (!empty($oneSlideParams)) {
$slide->setParams($oneSlideParams);
}
if (!empty($oneSlideLayers)) {
$slide->setLayers($oneSlideLayers);
}
$newSlides[] = $slide;
//add 2 slides
$newSlides[] = $slide;
}
}
return $newSlides;
}