コード例 #1
0
 function widget($args, $instance)
 {
     $cache = wp_cache_get('widget_nivo_slider_for_current_post', 'widget');
     if (!is_array($cache)) {
         $cache = array();
     }
     if (isset($cache[$args['widget_id']])) {
         echo $cache[$args['widget_id']];
         return;
     }
     ob_start();
     extract($args);
     echo $before_widget;
     if ($instance['title']) {
         echo $before_title . $instance['title'] . $after_title;
     }
     echo get_easy_nivo_slider_for_current_post($instance);
     echo $after_widget;
     $cache[$args['widget_id']] = ob_get_flush();
     wp_cache_set('widget_nivo_slider_for_current_post', $cache, 'widget');
 }
コード例 #2
0
function easy_nivo_slider_for_current_post($parms = NULL)
{
    echo get_easy_nivo_slider_for_current_post($parms);
}
コード例 #3
0
function get_easy_nivo_slider($atts)
{
    if (!$atts) {
        $atts = array();
        $atts['post_type'] = 'post';
    }
    if ('' != $atts['category']) {
        $atts['taxonomy'] = 'category';
        $atts['term'] = $atts['category'];
    }
    switch ($atts['source']) {
        // ----------------
        //
        // ----------------
        case 'current-post':
            return get_easy_nivo_slider_for_current_post($atts);
            break;
            // ----------------
            // Handle NextGen gallery.
            // If Nivo-NextGen was deactivated, reactivate it rather than throw an error message
            // ----------------
        // ----------------
        // Handle NextGen gallery.
        // If Nivo-NextGen was deactivated, reactivate it rather than throw an error message
        // ----------------
        case 'nextgen':
            if (!function_exists('get_easy_nivo_slider_for_nextgen')) {
                include_once 'nextgen/functions.php';
                include_once 'nextgen/list-images.php';
            }
            return get_easy_nivo_slider_for_nextgen($atts);
            break;
            // ----------------
            //
            // ----------------
        // ----------------
        //
        // ----------------
        default:
            return get_easy_nivo_slider_for_featured_images($atts);
    }
}