Created
February 12, 2021 17:19
-
-
Save kreamweb/16d70c9d50b4eec43c9e074f9fdc3966 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'x_sliders_meta', 'x_revolution_slider_add_slider_meta_tweek', 1 ); | |
function x_revolution_slider_add_slider_meta_tweek( $meta ) { | |
return array_merge( $meta, x_revolution_slider_get_slider_meta_tweek() ); | |
} | |
if( !function_exists('x_revolution_slider_get_slider_meta_tweek')){ | |
function x_revolution_slider_get_slider_meta_tweek() { | |
$rs = new RevSlider(); | |
$sliders = $rs->getArrSliders(); | |
$data = array(); | |
foreach ( $sliders as $s ) { | |
$key = 'x-slider-rs-' . $s->getID(); | |
$data[$key]['id'] = $s->getID(); | |
$data[$key]['slug'] = $s->getAlias(); | |
$data[$key]['name'] = $s->getTitle(); | |
$data[$key]['source'] = 'Revolution Slider'; | |
} | |
usort($data, function($a, $b) { | |
return $a['name'] <=> $b['name']; | |
}); | |
remove_filter( 'x_sliders_meta', 'x_revolution_slider_add_slider_meta' ); | |
return $data; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment