prefix = Easy_get_prefix(); /* Set the widget textdomain. */ $this->textdomain = Easy_get_textdomain(); /* Set up the widget options. */ $widget_options = array( 'classname' => 'archives', 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your archives.', $this->textdomain ) ); /* Set up the widget control options. */ $control_options = array( 'width' => 525, 'height' => 350, 'id_base' => "{$this->prefix}-archives" ); /* Create the widget. */ $this->WP_Widget( "{$this->prefix}-archives", esc_attr__( 'Archives', $this->textdomain ), $widget_options, $control_options ); } /** * Outputs the widget based on the arguments input through the widget controls. * @since 0.6.0 */ function widget( $args, $instance ) { extract( $args ); /* Set up the arguments for wp_get_archives(). */ $args = array( 'type' => $instance['type'], 'format' => $instance['format'], 'before' => $instance['before'], 'after' => $instance['after'], 'show_post_count' => !empty( $instance['show_post_count'] ) ? true : false, 'limit' => !empty( $instance['limit'] ) ? intval( $instance['limit'] ) : '', 'echo' => false ); /* 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 ) ); /* If the archives should be shown in a element and each