本文整理汇总了PHP中RevSliderOperations::remove_preset_setting方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderOperations::remove_preset_setting方法的具体用法?PHP RevSliderOperations::remove_preset_setting怎么用?PHP RevSliderOperations::remove_preset_setting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderOperations
的用法示例。
在下文中一共展示了RevSliderOperations::remove_preset_setting方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAjaxAction
/**
*
* onAjax action handler
*/
public static function onAjaxAction()
{
$slider = new RevSlider();
$slide = new RevSlide();
$operations = new RevSliderOperations();
$action = self::getPostGetVar("client_action");
$data = self::getPostGetVar("data");
$nonce = self::getPostGetVar("nonce");
if (empty($nonce)) {
$nonce = self::getPostGetVar("rs-nonce");
}
try {
//verify the nonce
$isVerified = wp_verify_nonce($nonce, "revslider_actions");
if ($isVerified == false) {
RevSliderFunctions::throwError("Wrong request");
}
switch ($action) {
case 'add_new_preset':
if (!isset($data['settings']) || !isset($data['values'])) {
self::ajaxResponseError(__('Missing values to add preset', 'revslider'), false);
}
$result = $operations->add_preset_setting($data);
if ($result === true) {
$presets = $operations->get_preset_settings();
self::ajaxResponseSuccess(__('Preset created', 'revslider'), array('data' => $presets));
} else {
self::ajaxResponseError($result, false);
}
exit;
break;
case 'update_preset':
if (!isset($data['name']) || !isset($data['values'])) {
self::ajaxResponseError(__('Missing values to update preset', 'revslider'), false);
}
$result = $operations->update_preset_setting($data);
if ($result === true) {
$presets = $operations->get_preset_settings();
self::ajaxResponseSuccess(__('Preset created', 'revslider'), array('data' => $presets));
} else {
self::ajaxResponseError($result, false);
}
exit;
break;
case 'remove_preset':
if (!isset($data['name'])) {
self::ajaxResponseError(__('Missing values to remove preset', 'revslider'), false);
}
$result = $operations->remove_preset_setting($data);
if ($result === true) {
$presets = $operations->get_preset_settings();
self::ajaxResponseSuccess(__('Preset deleted', 'revslider'), array('data' => $presets));
} else {
self::ajaxResponseError($result, false);
}
exit;
break;
case "export_slider":
$sliderID = self::getGetVar("sliderid");
$dummy = self::getGetVar("dummy");
$slider->initByID($sliderID);
$slider->exportSlider($dummy);
break;
case "import_slider":
$updateAnim = self::getPostGetVar("update_animations");
$updateNav = self::getPostGetVar("update_navigations");
$updateStatic = self::getPostGetVar("update_static_captions");
self::importSliderHandle(null, $updateAnim, $updateStatic, $updateNav);
break;
case "import_slider_slidersview":
$viewBack = self::getViewUrl(self::VIEW_SLIDERS);
$updateAnim = self::getPostGetVar("update_animations");
$updateNav = self::getPostGetVar("update_navigations");
$updateStatic = self::getPostGetVar("update_static_captions");
self::importSliderHandle($viewBack, $updateAnim, $updateStatic, $updateNav);
break;
case "import_slider_online_template_slidersview":
$viewBack = self::getViewUrl(self::VIEW_SLIDERS);
self::importSliderOnlineTemplateHandle($viewBack, 'true', 'none');
break;
case "import_slide_online_template_slidersview":
$redirect_id = esc_attr(self::getPostGetVar("redirect_id"));
$viewBack = self::getViewUrl(self::VIEW_SLIDE, "id={$redirect_id}");
$slidenum = intval(self::getPostGetVar("slidenum"));
$sliderid = intval(self::getPostGetVar("slider_id"));
self::importSliderOnlineTemplateHandle($viewBack, 'true', 'none', array('slider_id' => $sliderid, 'slide_id' => $slidenum));
break;
case "import_slider_template_slidersview":
$viewBack = self::getViewUrl(self::VIEW_SLIDERS);
$updateAnim = self::getPostGetVar("update_animations");
$updateStatic = self::getPostGetVar("update_static_captions");
self::importSliderTemplateHandle($viewBack, $updateAnim, $updateStatic);
break;
case "import_slide_template_slidersview":
$redirect_id = esc_attr(self::getPostGetVar("redirect_id"));
$viewBack = self::getViewUrl(self::VIEW_SLIDE, "id={$redirect_id}");
//.........这里部分代码省略.........