'recent-posts', 'description' => __( "Your site’s most recent Posts.", 'anaglyph-lite') ); parent::__construct('anaglyph-wrp', __('Anaglyph Recent Posts', 'anaglyph-lite'), $widget_ops); $this->alt_option_name = 'anaglyph-wrp'; } function widget($args, $instance) { $cache = wp_cache_get('widget_recent_posts', 'widget'); if ( !is_array($cache) ) $cache = array(); if ( ! isset( $args['widget_id'] ) ) $args['widget_id'] = $this->id; if ( isset( $cache[ $args['widget_id'] ] ) ) { echo $cache[ $args['widget_id'] ]; return; } ob_start(); extract($args); $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Posts', 'anaglyph-lite' ); $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 10; if ( ! $number ) $number = 10; $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false; $show_comments = isset( $instance['show_comments'] ) ? $instance['show_comments'] : false; $r = new WP_Query( apply_filters( 'widget_posts_args', array( 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true ) ) ); if ($r->have_posts()) : ?>
id="get_field_id( 'show_date' ); ?>" name="get_field_name( 'show_date' ); ?>" />
id="get_field_id( 'show_comments' ); ?>" name="get_field_name( 'show_comments' ); ?>" />
__( "A cloud of your most used tags.", 'anaglyph-lite') ); parent::__construct('anaglyph_tc', __('Anaglyph Tag Cloud', 'anaglyph-lite'), $widget_ops); } function widget( $args, $instance ) { extract($args); $current_taxonomy = $this->_get_current_taxonomy($instance); if ( !empty($instance['title']) ) { $title = $instance['title']; } else { if ( 'post_tag' == $current_taxonomy ) { $title = __('Tags', 'anaglyph-lite'); } else { $tax = get_taxonomy($current_taxonomy); $title = $tax->labels->name; } } $title = apply_filters('widget_title', $title, $instance, $this->id_base); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; $tags = get_terms( $current_taxonomy, array( 'orderby' => 'count', 'order' => 'DESC' )); if ( empty( $tags ) || is_wp_error( $tags ) ) return; echo '\n"; echo $after_widget; } function update( $new_instance, $old_instance ) { $instance['title'] = strip_tags(stripslashes($new_instance['title'])); $instance['taxonomy'] = stripslashes($new_instance['taxonomy']); return $instance; } function form( $instance ) { $current_taxonomy = $this->_get_current_taxonomy($instance); ?>