本文整理汇总了PHP中RevSliderBase::stripslashes_deep方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderBase::stripslashes_deep方法的具体用法?PHP RevSliderBase::stripslashes_deep怎么用?PHP RevSliderBase::stripslashes_deep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderBase
的用法示例。
在下文中一共展示了RevSliderBase::stripslashes_deep方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_all_navigations
/**
* Get all Navigations
* @since: 5.0
**/
public static function get_all_navigations($defaults = true)
{
global $wpdb;
$navigations = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . RevSliderGlobals::TABLE_NAVIGATION_NAME, ARRAY_A);
foreach ($navigations as $key => $nav) {
$navigations[$key]['css'] = RevSliderBase::stripslashes_deep(json_decode($navigations[$key]['css'], true));
$navigations[$key]['markup'] = RevSliderBase::stripslashes_deep(json_decode($navigations[$key]['markup'], true));
if (isset($navigations[$key]['settings'])) {
$navigations[$key]['settings'] = RevSliderBase::stripslashes_deep(json_decode($navigations[$key]['settings'], true));
}
}
if ($defaults) {
$def = self::get_default_navigations();
if (!empty($def)) {
foreach ($def as $key => $nav) {
$def[$key]['css'] = RevSliderBase::stripslashes_deep(json_decode($def[$key]['css'], true));
$def[$key]['markup'] = RevSliderBase::stripslashes_deep(json_decode($def[$key]['markup'], true));
}
if (isset($def[$key]['settings'])) {
$def[$key]['settings'] = RevSliderBase::stripslashes_deep(json_decode($def[$key]['settings'], true));
}
$navigations = array_merge($navigations, $def);
}
}
return $navigations;
}
示例2: get_all_navigations
/**
* Get all Navigations
* @since: 5.0
**/
public static function get_all_navigations($defaults = true, $raw = false)
{
global $wpdb;
$navigations = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . RevSliderGlobals::TABLE_NAVIGATION_NAME, ARRAY_A);
if ($raw == false) {
foreach ($navigations as $key => $nav) {
$navigations[$key]['css'] = RevSliderBase::stripslashes_deep(json_decode($navigations[$key]['css'], true));
$navigations[$key]['markup'] = RevSliderBase::stripslashes_deep(json_decode($navigations[$key]['markup'], true));
if (isset($navigations[$key]['settings'])) {
$navigations[$key]['settings'] = RevSliderBase::stripslashes_deep(json_decode($navigations[$key]['settings'], true));
if (!is_array($navigations[$key]['settings'])) {
$navigations[$key]['settings'] = json_decode($navigations[$key]['settings'], true);
}
}
}
}
if ($defaults) {
$def = self::get_default_navigations();
$default_presets = get_option('revslider-nav-preset-default', array());
if (!empty($def)) {
if ($raw == false) {
foreach ($def as $key => $nav) {
$def[$key]['css'] = RevSliderBase::stripslashes_deep(json_decode($def[$key]['css'], true));
$def[$key]['markup'] = RevSliderBase::stripslashes_deep(json_decode($def[$key]['markup'], true));
if (isset($def[$key]['settings'])) {
$def[$key]['settings'] = RevSliderBase::stripslashes_deep(json_decode($def[$key]['settings'], true));
if (!is_array($def[$key]['settings'])) {
$def[$key]['settings'] = json_decode($def[$key]['settings'], true);
}
}
//add custom settings (placeholders) to the default navigation
if (!empty($default_presets)) {
if (!isset($def[$key]['settings'])) {
$def[$key]['settings'] = array();
}
if (!isset($def[$key]['settings']['presets'])) {
$def[$key]['settings']['presets'] = array();
}
foreach ($default_presets as $id => $v) {
if ($id !== $def[$key]['id']) {
continue;
}
foreach ($v as $values) {
$def[$key]['settings']['presets'][] = $values;
}
}
}
}
}
$navigations = array_merge($navigations, $def);
}
}
return $navigations;
}