'widget_archive', 'description' => __( 'An archive of your site’s posts') ); $this->WP_Widget( 'archivist_archives', 'Archivist', $widget_ops ); } function widget( $args, $instance ) { extract( $args ); $args = wp_parse_args( (array) $args, array( 'title' => '', 'count' => 0, 'dropdown' => '', 'limit' => 0, 'type' => 'monthly' ) ); $c = $instance['count'] ? '1' : '0'; $d = $instance['dropdown'] ? '1' : '0'; $l = $instance['limit']; $t = $instance['type']; $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Archives' ) : $instance['title'], $instance, $this->id_base ); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; $archive_args = array( 'type' => $t, 'show_post_count' => $c ); if ( $l > 0 ) $archive_args['limit'] = $l; if ( $d ) { $archive_args['format'] = 'option'; ?> '', 'count' => 0, 'dropdown' => '', 'limit' => 0, 'type' => 'monthly' ) ); $instance['title'] = strip_tags( $new_instance['title'] ); $instance['count'] = $new_instance['count'] ? 1 : 0; $instance['limit'] = $new_instance['limit']; $instance['type'] = $new_instance['type']; $instance['dropdown'] = $new_instance['dropdown'] ? 1 : 0; return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'count' => 0, 'dropdown' => '', 'limit' => 0 ) ); $type = array( 'yearly' => '', 'monthly' => '', 'weekly' => '', 'daily' => '', 'postbypost' => '' ); $title = strip_tags($instance['title']); $limit = $instance['limit'] > 0 ? $instance['limit'] : ''; $type[$instance['type']] = 'selected="selected"'; $count = $instance['count'] ? 'checked="checked"' : ''; $dropdown = $instance['dropdown'] ? 'checked="checked"' : ''; ?>

id="get_field_id( 'count' ); ?>" name="get_field_name('count'); ?>" />
id="get_field_id( 'dropdown' ); ?>" name="get_field_name( 'dropdown' ); ?>" />