prefix = framework_get_prefix(); /* Set up the widget options. */ $widget_options = array( 'classname' => 'archives', 'description' => esc_html__( 'A monthly archive of your site\'s posts.', 'wordsmith' ) ); /* Set up the widget control options. */ $control_options = array( 'width' => 200, 'height' => 350 ); /* Create the widget. */ $this->WP_Widget( "{$this->prefix}-archives", __( 'Archives', 'wordsmith' ), $widget_options, $control_options ); } /* Outputs the widget based on the arguments input through the widget controls. */ function widget( $args, $instance ) { extract( $args ); /* Arguments for the widget. */ $args = array( 'echo' => false, 'format' => 'html', 'show_post_count' => true ); $args['type'] = $instance['type']; $args['limit'] = !empty( $instance['limit'] ) ? intval( $instance['limit'] ) : ''; /* Output the theme's $before_widget wrapper. */ echo $before_widget; /* If a title was input by the user, display it. */ if ( !empty( $instance['title'] ) ) echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title; /* Get the archives list. */ $archives = str_replace( array( '\r', '\n', '\t' ), '', wp_get_archives( $args ) ); $archives = str_replace( '(', '', $archives ); $archives = str_replace( ')', '', $archives ); echo '