/** * Upcoming Show widget shortcode * * @param array $atts * @param array $content * * @return string */ function wolf_shortcode_last_photos_widget($atts, $content = null) { if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) { $atts = vc_map_get_attributes('wolf_last_photos_widget', $atts); } extract(shortcode_atts(array('count' => 10), $atts)); if (function_exists('wolf_get_photos_widget')) { return wolf_get_photos_widget($count); } }
/** * widget function. * * @see WP_Widget * @param array $args * @param array $instance */ function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $desc = $instance['desc']; $count = isset($instance['count']) ? $instance['count'] : 12; echo $before_widget; if (!empty($title)) { echo $before_title . $title . $after_title; } if (!empty($desc)) { echo '<p>'; echo $desc; echo '</p>'; } echo wolf_get_photos_widget($count); echo $after_widget; }