/** * Enqueue styles and scripts after theme. * * @since 1.15.0 */ function wpmtst_scripts_after_theme() { wpmtst_register_cycle(); $styles = WPMST()->get_styles(); if ($styles) { foreach ($styles['later'] as $key => $style) { wp_enqueue_style($style); } } $scripts = WPMST()->get_scripts(); if ($scripts) { foreach ($scripts['later'] as $key => $script) { wp_enqueue_script($script); } } }
/** * Set up the slideshow. * * @since 2.3 As separate function. * @param array $atts */ private static function after_slideshow($atts = array()) { if (!wp_script_is('wpmtst-slider', 'registered')) { wpmtst_register_cycle(); } if (!wp_script_is('wpmtst-slider', 'enqueued')) { wp_enqueue_script('wpmtst-slider'); } // Populate variable for Cycle script. $args = array('fx' => 'fade', 'speed' => $atts['effect_for'] * 1000, 'timeout' => $atts['show_for'] * 1000, 'pause' => $atts['no_pause'] ? 0 : 1); wp_localize_script('wpmtst-slider', 'strong_cycle_' . hash('md5', serialize($args)), $args); }