Preview: plugin.revslider.php
Size: 4.28 KB
/proc/self/root/home/nshryvcy/taramarriagebureau.com/wp-content/themes/planmyday/plugins/plugin.revslider.php
<?php
/* Revolution Slider support functions
------------------------------------------------------------------------------- */
// Theme init
if (!function_exists('planmyday_revslider_theme_setup')) {
add_action( 'planmyday_action_before_init_theme', 'planmyday_revslider_theme_setup', 1 );
function planmyday_revslider_theme_setup() {
if (planmyday_exists_revslider()) {
add_filter( 'planmyday_filter_list_sliders', 'planmyday_revslider_list_sliders' );
add_filter( 'planmyday_filter_theme_options_params', 'planmyday_revslider_theme_options_params' );
}
if (is_admin()) {
add_filter( 'planmyday_filter_required_plugins', 'planmyday_revslider_required_plugins' );
}
}
}
if ( !function_exists( 'planmyday_revslider_settings_theme_setup2' ) ) {
add_action( 'planmyday_action_before_init_theme', 'planmyday_revslider_settings_theme_setup2', 3 );
function planmyday_revslider_settings_theme_setup2() {
if (planmyday_exists_revslider()) {
// Add Revslider specific options in the Theme Options
planmyday_storage_set_array_after('options', 'slider_engine', "slider_alias", array(
"title" => esc_html__('Revolution Slider: Select slider', 'planmyday'),
"desc" => wp_kses_data( __("Select slider to show (if engine=revo in the field above)", 'planmyday') ),
"override" => "category,services_group,page",
"dependency" => array(
'show_slider' => array('yes'),
'slider_engine' => array('revo')
),
"std" => "",
"options" => planmyday_get_options_param('list_revo_sliders'),
"type" => "select"
)
);
}
}
}
// Check if RevSlider installed and activated
if ( !function_exists( 'planmyday_exists_revslider' ) ) {
function planmyday_exists_revslider() {
return function_exists('rev_slider_shortcode');
}
}
// Filter to add in the required plugins list
if ( !function_exists( 'planmyday_revslider_required_plugins' ) ) {
//Handler of add_filter('planmyday_filter_required_plugins', 'planmyday_revslider_required_plugins');
function planmyday_revslider_required_plugins($list=array()) {
if (in_array('revslider', planmyday_storage_get('required_plugins'))) {
$path = planmyday_get_file_dir('plugins/install/revslider.zip');
if (file_exists($path)) {
$list[] = array(
'name' => esc_html__('Revolution Slider', 'planmyday'),
'slug' => 'revslider',
'version' => '6.7.29',
'source' => $path,
'required' => false
);
}
}
return $list;
}
}
// Lists
//------------------------------------------------------------------------
// Add RevSlider in the sliders list, prepended inherit (if need)
if ( !function_exists( 'planmyday_revslider_list_sliders' ) ) {
//Handler of add_filter( 'planmyday_filter_list_sliders', 'planmyday_revslider_list_sliders' );
function planmyday_revslider_list_sliders($list=array()) {
$list["revo"] = esc_html__("Layer slider (Revolution)", 'planmyday');
return $list;
}
}
// Return Revo Sliders list, prepended inherit (if need)
if ( !function_exists( 'planmyday_get_list_revo_sliders' ) ) {
function planmyday_get_list_revo_sliders($prepend_inherit=false) {
if (($list = planmyday_storage_get('list_revo_sliders'))=='') {
$list = array();
if (planmyday_exists_revslider()) {
global $wpdb;
// Attention! The use of wpdb->prepare() is not required
// because the query does not use external data substitution
$rows = $wpdb->get_results( "SELECT alias, title FROM " . esc_sql($wpdb->prefix) . "revslider_sliders" );
if (is_array($rows) && count($rows) > 0) {
foreach ($rows as $row) {
$list[$row->alias] = $row->title;
}
}
}
$list = apply_filters('planmyday_filter_list_revo_sliders', $list);
if (planmyday_get_theme_setting('use_list_cache')) planmyday_storage_set('list_revo_sliders', $list);
}
return $prepend_inherit ? planmyday_array_merge(array('inherit' => esc_html__("Inherit", 'planmyday')), $list) : $list;
}
}
// Add RevSlider in the Theme Options params
if ( !function_exists( 'planmyday_revslider_theme_options_params' ) ) {
//Handler of add_filter( 'planmyday_filter_theme_options_params', 'planmyday_revslider_theme_options_params' );
function planmyday_revslider_theme_options_params($list=array()) {
$list["list_revo_sliders"] = array('$planmyday_get_list_revo_sliders' => '');
return $list;
}
}
?>
Directory Contents
Dirs: 1 × Files: 18