'arpw_widget', 'description' => __( 'Enable advanced random posts widget.', 'arpw' ) ); $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'arpw_widget' ); $this->WP_Widget( 'arpw_widget', __( 'Advanced Random Posts', 'arpw' ), $widget_ops, $control_ops ); } /** * Display widget */ function widget( $args, $instance ) { extract( $args, EXTR_SKIP ); $title = apply_filters( 'widget_title', $instance['title'] ); $limit = $instance['limit']; $excerpt = $instance['excerpt']; $length = (int)( $instance['length'] ); $thumb = $instance['thumb']; $thumb_height = (int)( $instance['thumb_height'] ); $thumb_width = (int)( $instance['thumb_width'] ); $cat = $instance['cat']; $date = $instance['date']; echo $before_widget; if (!empty( $title )) echo $before_title . $title . $after_title; global $post; $args = array( 'numberposts' => $limit, 'cat' => $cat, 'post_type' => 'post', 'orderby' => 'rand' ); $arpwwidget = get_posts( $args ); ?>
'', 'limit' => 5, 'excerpt' => '', 'length' => 10, 'thumb' => true, 'thumb_height' => 45, 'thumb_width' => 45, 'cat' => '', 'date' => true ); $instance = wp_parse_args( (array) $instance, $defaults ); $title = strip_tags( $instance['title'] ); $limit = $instance['limit']; $excerpt = $instance['excerpt']; $length = (int)($instance['length']); $thumb = $instance['thumb']; $thumb_height = (int)( $instance['thumb_height'] ); $thumb_width = (int)( $instance['thumb_width'] ); $cat = $instance['cat']; $date = $instance['date']; ?>

/> 

/> 

/> 

$this->get_field_name( 'cat' ), 'show_option_all' => __( 'All categories' , 'arpw' ), 'hide_empty' => 1, 'hierarchical' => 1, 'selected' => $cat ) ); ?>

Satrya', 'arpw' ), esc_url( 'http://satrya.me' ) ); ?>

=$length ) { array_pop( $excerpt ); $excerpt = implode( " ", $excerpt ) . '…'; } else { $excerpt = implode( " ", $excerpt ); } $excerpt = preg_replace( '`\[[^\]]*\]`', '', $excerpt ); return $excerpt; } ?>