Created
June 16, 2015 17:29
-
-
Save dimsemenov/0e46da0a88454fc04e95 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
function fire_royalslider_func($atts){ | |
$sliderid = $atts['id']; | |
$out = ''; | |
if (!$sliderid) return; | |
/* Print slider HTML, skip this part if you already have it on page */ | |
$out .= get_new_royalslider($sliderid); | |
/* Print slider END */ | |
// Init code | |
include_once(ABSPATH.'wp-content/plugins/new-royalslider/classes/NewRoyalSliderMain.php'); | |
$init_codes = NewRoyalSliderMain::$sliders_init_code; | |
if(count($init_codes) > 0 ) { | |
$out .= '<script>'; | |
$out .= "jQuery(document).ready(function($) {\n"; | |
foreach($init_codes as $key => $value) { | |
$out .= $value; | |
} | |
$out .= "});\n"; | |
$out .= '</script>'; | |
} | |
return $out; | |
} | |
add_shortcode('fire_royalslider', 'fire_royalslider_func'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment