function widget($args, $instance) { if ($this->preventRender) { return; } $instance = array_merge(array('id' => md5(time()), 'slider' => 0), $instance); $slider = N2SS3Shortcode::render(array('id' => $instance['id'], 'slider' => $instance['slider']), 'WordPress widget'); if ($slider != '') { $title = apply_filters('widget_title', $instance['title']); echo $args['before_widget']; if (!empty($title)) { echo $args['before_title'] . $title . $args['after_title']; } echo $slider; echo $args['after_widget']; } }
function shortcode_callback($atts, $content = null, $function_name) { $sliderId = $this->shortcode_atts['slider']; return N2SS3Shortcode::render(array('slider' => $sliderId), 'Divi module'); }