. * More escaping. * The dropdown is now filtered with 'wp_dropdown_cats.' * This enables adding an 'on' attribute, with the id of the form. * So changing the dropdown value will redirect to the category page, with valid AMP. * * @since 0.7.0 * * @param array $args Widget display data. * @param array $instance Data for widget. * @return void. */ public function widget( $args, $instance ) { if ( ! is_amp_endpoint() ) { parent::widget( $args, $instance ); return; } $c = ! empty( $instance['count'] ) ? '1' : '0'; $d = ! empty( $instance['dropdown'] ) ? '1' : '0'; /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Archives', 'default' ) : $instance['title'], $instance, $this->id_base ); echo wp_kses_post( $args['before_widget'] ); if ( $title ) : echo wp_kses_post( $args['before_title'] . $title . $args['after_title'] ); endif; if ( $d ) : $dropdown_id = "{$this->id_base}-dropdown-{$this->number}"; ?>